WT1.1.0+42 error fixes

This commit is contained in:
bossanyit
2020-12-30 21:50:11 +01:00
parent 2aecb9d431
commit 14b5b44347
14 changed files with 142 additions and 99 deletions
+4 -2
View File
@@ -70,7 +70,7 @@ class Cache with Logging {
String authToken = "";
Customer userLoggedIn;
String firebaseUid;
Purchase purchased;
bool hasPurchased = false;
bool firstLoad = true;
@@ -81,7 +81,7 @@ class Cache with Logging {
ExercisePlan _myExercisePlan;
List<Property> _properties;
List<Product> _products;
List<Purchase> _purchases;
List<Purchase> _purchases = List();
List<ProductTest> _productTests;
List<ExerciseDevice> _devices;
@@ -436,5 +436,7 @@ class Cache with Logging {
CustomerRepository customerRepository = CustomerRepository(customer: this.userLoggedIn);
await customerRepository.getPurchase();
await customerRepository.getProductTests();
this.hasPurchased = this._purchases.isNotEmpty;
}
}
+4
View File
@@ -245,6 +245,10 @@ class ExerciseRepository {
}
void sortByDate() {
if (exerciseList.isEmpty) {
return;
}
exerciseList.sort((a, b) => b.dateAdd.compareTo(a.dateAdd));
this.exerciseLogList = List();
+11 -9
View File
@@ -209,15 +209,17 @@ class _ExerciseLogPage extends State<ExerciseLogPage> with Trans, Common {
evaluation();
},
),
GestureDetector(
child: Image.asset(
'asset/image/lock.png',
height: 25,
width: 25,
),
onTap: () {
evaluation();
}),
Cache().hasPurchased
? Offstage()
: GestureDetector(
child: Image.asset(
'asset/image/lock.png',
height: 25,
width: 25,
),
onTap: () {
evaluation();
}),
],
),
IconButton(
+20 -18
View File
@@ -26,24 +26,26 @@ class _MyDevelopmentBodyPage extends State<MyDevelopmentBodyPage> with Trans, Co
@override
void initState() {
super.initState();
Timer(
Duration(milliseconds: 2000),
() => {
showDialog(
context: context,
barrierDismissible: false,
builder: (BuildContext context) {
setContext(context);
return DialogPremium(
unlocked: false,
unlockRound: 2,
function: "My Whole Body Development",
unlockedText: "",
onTap: () => {Navigator.of(context).pop(), Navigator.of(context).pop()},
onCancel: () => {Navigator.of(context).pop(), Navigator.of(context).pop()},
);
})
});
if (!Cache().hasPurchased) {
Timer(
Duration(milliseconds: 2000),
() => {
showDialog(
context: context,
barrierDismissible: false,
builder: (BuildContext context) {
setContext(context);
return DialogPremium(
unlocked: false,
unlockRound: 2,
function: "My Whole Body Development",
unlockedText: "",
onTap: () => {Navigator.of(context).pop(), Navigator.of(context).pop()},
onCancel: () => {Navigator.of(context).pop(), Navigator.of(context).pop()},
);
})
});
}
/// We require the initializers to run after the loading screen is rendered
SchedulerBinding.instance.addPostFrameCallback((_) {
+24 -17
View File
@@ -1,5 +1,6 @@
import 'dart:async';
import 'dart:collection';
import 'package:aitrainer_app/model/cache.dart';
import 'package:aitrainer_app/util/trans.dart';
import 'package:aitrainer_app/widgets/app_bar.dart';
import 'package:aitrainer_app/widgets/dialog_premium.dart';
@@ -30,23 +31,25 @@ class _MyDevelopmentMuscleState extends State<MyDevelopmentMusclePage> with Comm
@override
void initState() {
super.initState();
Timer(
Duration(milliseconds: 2000),
() => {
showDialog(
context: context,
barrierDismissible: false,
builder: (BuildContext context) {
return DialogPremium(
unlocked: false,
unlockRound: 1,
function: "Development Of Muscles",
unlockedText: "",
onTap: () => {Navigator.of(context).pop(), Navigator.of(context).pop()},
onCancel: () => {Navigator.of(context).pop(), Navigator.of(context).pop()},
);
})
});
if (!Cache().hasPurchased) {
Timer(
Duration(milliseconds: 2000),
() => {
showDialog(
context: context,
barrierDismissible: false,
builder: (BuildContext context) {
return DialogPremium(
unlocked: false,
unlockRound: 1,
function: "Development Of Muscles",
unlockedText: "",
onTap: () => {Navigator.of(context).pop(), Navigator.of(context).pop()},
onCancel: () => {Navigator.of(context).pop(), Navigator.of(context).pop()},
);
})
});
}
/// We require the initializers to run after the loading screen is rendered
SchedulerBinding.instance.addPostFrameCallback((_) {
@@ -166,6 +169,7 @@ class _MyDevelopmentMuscleState extends State<MyDevelopmentMusclePage> with Comm
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
ChoiceChip(
labelPadding: EdgeInsets.only(right: 5),
avatar: Icon(Icons.timer),
label: Text(t('Detailed')),
labelStyle: TextStyle(fontSize: 9, color: Colors.black),
@@ -175,6 +179,7 @@ class _MyDevelopmentMuscleState extends State<MyDevelopmentMusclePage> with Comm
onSelected: (value) => {bloc.add(DevelopmentByMuscleDateRateChange(dateRate: DateRate.daily))},
),
ChoiceChip(
labelPadding: EdgeInsets.only(right: 5),
avatar: Icon(Icons.timer),
label: Text(t('Weekly')),
labelStyle: TextStyle(fontSize: 9, color: Colors.black),
@@ -185,6 +190,7 @@ class _MyDevelopmentMuscleState extends State<MyDevelopmentMusclePage> with Comm
onSelected: (value) => {bloc.add(DevelopmentByMuscleDateRateChange(dateRate: DateRate.weekly))},
),
ChoiceChip(
labelPadding: EdgeInsets.only(right: 5),
avatar: Icon(Icons.timer),
label: Text(t('Monthly')),
labelStyle: TextStyle(fontSize: 9, color: Colors.black),
@@ -194,6 +200,7 @@ class _MyDevelopmentMuscleState extends State<MyDevelopmentMusclePage> with Comm
onSelected: (value) => {bloc.add(DevelopmentByMuscleDateRateChange(dateRate: DateRate.monthly))},
),
ChoiceChip(
labelPadding: EdgeInsets.only(right: 5),
avatar: Icon(Icons.timer),
label: Text(t('Yearly')),
labelStyle: TextStyle(fontSize: 9, color: Colors.black),
+4 -7
View File
@@ -48,7 +48,7 @@ class _MyDevelopmentPage extends State<MyDevelopmentPage> with Trans {
style: GoogleFonts.robotoMono(
textStyle: TextStyle(
fontSize: 14,
color: Colors.orange,
color: Colors.white,
fontWeight: FontWeight.bold,
backgroundColor: Colors.black54.withOpacity(0.4))),
image: "asset/image/edzesnaplom400400.jpg",
@@ -62,10 +62,7 @@ class _MyDevelopmentPage extends State<MyDevelopmentPage> with Trans {
text: t("My Whole Body Development"),
style: GoogleFonts.robotoMono(
textStyle: TextStyle(
fontSize: 14,
color: Colors.orange,
fontWeight: FontWeight.bold,
backgroundColor: Colors.black54.withOpacity(0.4)),
fontSize: 14, color: Colors.white, fontWeight: FontWeight.bold, backgroundColor: Colors.black54.withOpacity(0.4)),
),
image: "asset/image/testemfejl400x400.jpg",
left: 5,
@@ -82,7 +79,7 @@ class _MyDevelopmentPage extends State<MyDevelopmentPage> with Trans {
style: GoogleFonts.robotoMono(
textStyle: TextStyle(
fontSize: 14,
color: Colors.orange,
color: Colors.white,
fontWeight: FontWeight.bold,
backgroundColor: Colors.black54.withOpacity(0.4))),
image: "asset/image/izomcsop400400.jpg",
@@ -98,7 +95,7 @@ class _MyDevelopmentPage extends State<MyDevelopmentPage> with Trans {
style: GoogleFonts.robotoMono(
textStyle: TextStyle(
fontSize: 14,
color: Colors.orange,
color: Colors.white,
fontWeight: FontWeight.bold,
backgroundColor: Colors.black54.withOpacity(0.4))),
image: "asset/image/predictions.jpg",
+6 -6
View File
@@ -47,7 +47,7 @@ class _MyExercisePlanPage extends State<MyExercisePlanPage> with Trans, Logging
style: GoogleFonts.robotoMono(
textStyle: TextStyle(
fontSize: 14,
color: Colors.orange,
color: Colors.white,
fontWeight: FontWeight.bold,
backgroundColor: Colors.black54.withOpacity(0.4))),
image: "asset/image/exercise_plan_execute.jpg",
@@ -66,7 +66,7 @@ class _MyExercisePlanPage extends State<MyExercisePlanPage> with Trans, Logging
style: GoogleFonts.robotoMono(
textStyle: TextStyle(
fontSize: 14,
color: Colors.orange,
color: Colors.white,
fontWeight: FontWeight.bold,
backgroundColor: Colors.black54.withOpacity(0.4))),
image: "asset/image/exercise_plan_custom.jpg",
@@ -85,11 +85,11 @@ class _MyExercisePlanPage extends State<MyExercisePlanPage> with Trans, Logging
style: GoogleFonts.robotoMono(
textStyle: TextStyle(
fontSize: 14,
color: Colors.orange,
color: Colors.white,
fontWeight: FontWeight.bold,
backgroundColor: Colors.black54.withOpacity(0.4))),
image: "asset/image/exercise_plan_suggested.jpg",
left: 5,
left: 2,
onTap: () => {
showDialog(
context: context,
@@ -113,7 +113,7 @@ class _MyExercisePlanPage extends State<MyExercisePlanPage> with Trans, Logging
style: GoogleFonts.robotoMono(
textStyle: TextStyle(
fontSize: 14,
color: Colors.orange,
color: Colors.white,
fontWeight: FontWeight.bold,
backgroundColor: Colors.black54.withOpacity(0.4))),
image: "asset/image/exercise_plan_special.jpg",
@@ -141,7 +141,7 @@ class _MyExercisePlanPage extends State<MyExercisePlanPage> with Trans, Logging
style: GoogleFonts.robotoMono(
textStyle: TextStyle(
fontSize: 14,
color: Colors.orange,
color: Colors.white,
fontWeight: FontWeight.bold,
backgroundColor: Colors.black54.withOpacity(0.4))),
image: "asset/image/exercise_plan_stars.jpg",
+28 -3
View File
@@ -7,12 +7,14 @@ class DialogCommon extends StatefulWidget {
final String title, descriptions, text;
final VoidCallback onTap;
final VoidCallback onCancel;
String description2;
String description2, description3;
final Image img;
DialogCommon({Key key, this.title, this.descriptions, this.description2, this.text, this.img, this.onTap, this.onCancel})
DialogCommon(
{Key key, this.title, this.descriptions, this.description2, this.description3, this.text, this.img, this.onTap, this.onCancel})
: super(key: key) {
description2 = description2 ?? "";
description3 = description3 ?? "";
}
@override
@@ -129,7 +131,30 @@ class _DialogPremiumState extends State<DialogCommon> with Trans {
textAlign: TextAlign.center,
),
SizedBox(
height: 62,
height: 15,
),
Text(
widget.description3,
style: GoogleFonts.inter(
fontSize: 14,
color: Colors.white,
shadows: <Shadow>[
Shadow(
offset: Offset(5.0, 5.0),
blurRadius: 12.0,
color: Colors.black54,
),
Shadow(
offset: Offset(-3.0, 3.0),
blurRadius: 12.0,
color: Colors.black54,
),
],
),
textAlign: TextAlign.center,
),
SizedBox(
height: 52,
),
Align(
alignment: Alignment.center,
+28 -26
View File
@@ -50,7 +50,7 @@ class ImageButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
if (top == null) {
top = height - (style.fontSize - 5) * text.length - 2 * left < 0 ? height - 2 * style.fontSize - 22 : height - style.fontSize - 17;
top = height - (style.fontSize - 5) * text.length - 2 * left < 0 ? height - 2 * style.fontSize - 22 : height - style.fontSize - 37;
//print("Top: " + top.toStringAsFixed(0) + " length: " + ((style.fontSize - 5) * text.length).toString());
}
return Stack(
@@ -99,31 +99,33 @@ class ImageButton extends StatelessWidget {
color: Colors.transparent,
),
),
Stack(alignment: Alignment.topLeft, children: [
Positioned(
top: height / 2 - 30,
left: width / 2 - 30,
child: this.isLocked
? GestureDetector(
child: Image.asset(
'asset/image/lock.png',
height: 60,
width: 60,
),
onTap: onTap ?? onTap,
)
: isMarked
? GestureDetector(
child: Image.asset(
'asset/image/haken.png',
height: 70,
width: 70,
),
onTap: onTap ?? onTap,
)
: Container(),
)
]),
Cache().hasPurchased
? Offstage()
: Stack(alignment: Alignment.topLeft, children: [
Positioned(
top: height / 2 - 30,
left: width / 2 - 30,
child: this.isLocked
? GestureDetector(
child: Image.asset(
'asset/image/lock.png',
height: 60,
width: 60,
),
onTap: onTap ?? onTap,
)
: isMarked
? GestureDetector(
child: Image.asset(
'asset/image/haken.png',
height: 70,
width: 70,
),
onTap: onTap ?? onTap,
)
: Container(),
)
]),
]
//)
// )
+3 -2
View File
@@ -221,8 +221,9 @@ class _MenuPageWidgetState extends State<MenuPageWidget> with Trans, Logging {
builder: (BuildContext context) {
return DialogCommon(
title: menuBloc.infoTitle,
descriptions: menuBloc.infoText2,
description2: menuBloc.infoText3,
descriptions: menuBloc.infoText,
description2: menuBloc.infoText2,
description3: menuBloc.infoText3,
text: "OK",
onTap: () => {Navigator.of(context).pop()},
onCancel: () => {Navigator.of(context).pop()},