WT 1.1.18+4 A/B Test sales page

This commit is contained in:
bossanyit
2021-06-05 15:39:12 +02:00
parent d5deaf48a9
commit 0ca3b71c03
48 changed files with 734 additions and 1223 deletions
+3 -1
View File
@@ -156,7 +156,9 @@ class _AppBarNav extends State<AppBarNav> with SingleTickerProviderStateMixin, C
}
int sizeExerciseList = Cache().getExercises() == null ? 0 : Cache().getExercises()!.length;
if (sizeExerciseList == 0) {
String text = AppLocalizations.of(context)!.translate("Make your first test");
String text = Cache().userLoggedIn == null
? AppLocalizations.of(context)!.translate("Please log in")
: AppLocalizations.of(context)!.translate("Make your first test");
double fontSize = text.length > 24 ? 13 : 16;
return Stack(alignment: Alignment.topLeft, children: [
GestureDetector(
+9 -4
View File
@@ -9,7 +9,8 @@ import 'package:google_fonts/google_fonts.dart';
// ignore: must_be_immutable
class AppBarMin extends StatefulWidget implements PreferredSizeWidget {
bool back = false;
AppBarMin({this.back = false});
VoidCallback? onTap;
AppBarMin({this.back = false, this.onTap});
@override
_AppBarNav createState() => _AppBarNav();
@@ -46,9 +47,13 @@ class _AppBarNav extends State<AppBarMin> with Common {
),
leading: IconButton(
icon: Icon(Icons.arrow_back, color: widget.back ? Colors.white : Colors.black),
onPressed: () => {
timerBloc.add(TimerEnd(duration: 0)),
if (widget.back) {Navigator.of(context).pop()}
onPressed: () {
timerBloc.add(TimerEnd(duration: 0));
if (widget.onTap != null) {
widget.onTap!();
} else if (widget.back) {
Navigator.of(context).pop();
}
},
));
}
+12 -6
View File
@@ -313,9 +313,12 @@ class _BMIState extends State<BMI> with Trans {
textInputAction: TextInputAction.done,
style: GoogleFonts.archivoBlack(fontSize: 20, color: Colors.yellow[300]),
onChanged: (value) => {
value = value.replaceFirst(",", "."),
value = value.replaceAll(RegExp(r'[^0-9.]'), ""),
widget.exerciseBloc.add(ExerciseNewHeightChange(value: double.parse(value))),
if (value.isNotEmpty)
{
value = value.replaceFirst(",", "."),
value = value.replaceAll(RegExp(r'[^0-9.]'), ""),
widget.exerciseBloc.add(ExerciseNewHeightChange(value: double.parse(value))),
}
}),
);
} else {
@@ -397,9 +400,12 @@ class _BMIState extends State<BMI> with Trans {
textInputAction: TextInputAction.done,
style: GoogleFonts.archivoBlack(fontSize: 20, color: Colors.yellow[300]),
onChanged: (value) => {
value = value.replaceFirst(",", "."),
value = value.replaceAll(RegExp(r'[^0-9.]'), ""),
widget.exerciseBloc.add(ExerciseNewWeightChange(value: double.parse(value))),
if (value.isNotEmpty)
{
value = value.replaceFirst(",", "."),
value = value.replaceAll(RegExp(r'[^0-9.]'), ""),
widget.exerciseBloc.add(ExerciseNewWeightChange(value: double.parse(value))),
}
},
),
),
+17 -8
View File
@@ -217,9 +217,12 @@ class _BMRState extends State<BMR> with Trans {
textInputAction: TextInputAction.done,
style: GoogleFonts.archivoBlack(fontSize: 20, color: Colors.yellow[300]),
onChanged: (value) => {
value = value.replaceFirst(",", "."),
value = value.replaceAll(RegExp(r'[^0-9.]'), ""),
widget.exerciseBloc.add(ExerciseNewHeightChange(value: double.parse(value))),
if (value.isNotEmpty)
{
value = value.replaceFirst(",", "."),
value = value.replaceAll(RegExp(r'[^0-9.]'), ""),
widget.exerciseBloc.add(ExerciseNewHeightChange(value: double.parse(value))),
}
}),
);
} else {
@@ -248,8 +251,11 @@ class _BMRState extends State<BMR> with Trans {
textInputAction: TextInputAction.done,
style: GoogleFonts.archivoBlack(fontSize: 20, color: Colors.yellow[300]),
onChanged: (value) => {
value = value.replaceAll(RegExp(r'[^0-9.]'), ""),
widget.exerciseBloc.add(ExerciseNewBirthyearChange(value: int.parse(value)))
if (value.isNotEmpty)
{
value = value.replaceAll(RegExp(r'[^0-9.]'), ""),
widget.exerciseBloc.add(ExerciseNewBirthyearChange(value: int.parse(value)))
}
}),
);
}
@@ -373,9 +379,12 @@ class _BMRState extends State<BMR> with Trans {
textInputAction: TextInputAction.done,
style: GoogleFonts.archivoBlack(fontSize: 20, color: Colors.yellow[300]),
onChanged: (value) => {
value = value.replaceFirst(",", "."),
value = value.replaceAll(RegExp(r'[^0-9.]'), ""),
widget.exerciseBloc.add(ExerciseNewWeightChange(value: double.parse(value))),
if (value.isNotEmpty)
{
value = value.replaceFirst(",", "."),
value = value.replaceAll(RegExp(r'[^0-9.]'), ""),
widget.exerciseBloc.add(ExerciseNewWeightChange(value: double.parse(value))),
}
},
),
),
+1 -1
View File
@@ -162,7 +162,7 @@ class _DialogPremiumState extends State<DialogPremium> with Trans {
Align(
alignment: Alignment.center,
child: GestureDetector(
onTap: () => widget.unlocked ? Navigator.of(context).pop() : Navigator.of(context).pushNamed("salesPage"),
onTap: () => widget.unlocked ? Navigator.of(context).pop() : Navigator.of(context).popAndPushNamed("salesPage"),
child: Stack(
alignment: Alignment.center,
children: [
+12 -8
View File
@@ -281,11 +281,13 @@ class _ExerciseSaveState extends State<ExerciseSave> with Trans {
keyboardType: TextInputType.numberWithOptions(decimal: true),
textInputAction: TextInputAction.done,
style: GoogleFonts.archivoBlack(fontSize: 80, color: Colors.yellow[300]),
onChanged: (value) => {
value = value.replaceFirst(",", "."),
value = value.replaceAll(RegExp(r'[^0-9.]'), ""),
widget.onUnitQuantityChanged!(double.parse(value)),
}),
onChanged: (value) {
if (value.isNotEmpty) {
value = value.replaceFirst(",", ".");
value = value.replaceAll(RegExp(r'[^0-9.]'), "");
widget.onUnitQuantityChanged!(double.parse(value));
}
}),
]));
}
return row;
@@ -395,9 +397,11 @@ class _ExerciseSaveState extends State<ExerciseSave> with Trans {
textInputAction: TextInputAction.next,
style: GoogleFonts.archivoBlack(fontSize: 80, color: Colors.orange[200]),
onChanged: (value) {
value = value.replaceFirst(",", ".");
value = value.replaceAll(RegExp(r'[^0-9.]'), "");
widget.onQuantityChanged(double.parse(value));
if (value.isNotEmpty) {
value = value.replaceFirst(",", ".");
value = value.replaceAll(RegExp(r'[^0-9.]'), "");
widget.onQuantityChanged(double.parse(value));
}
},
),
]));
+6 -3
View File
@@ -157,9 +157,12 @@ class _InputDialogState<Event> extends State<InputDialog<Event>> with Trans {
textInputAction: TextInputAction.done,
style: GoogleFonts.archivoBlack(fontSize: 20, color: Colors.yellow[300]),
onChanged: (value) => {
value = value.replaceFirst(",", "."),
value = value.replaceAll(RegExp(r'[^0-9.]'), ""),
this.inputValue = double.parse(value),
if (value.isNotEmpty)
{
value = value.replaceFirst(",", "."),
value = value.replaceAll(RegExp(r'[^0-9.]'), ""),
this.inputValue = double.parse(value),
}
},
),
),
+1 -3
View File
@@ -81,9 +81,7 @@ class _VictoryState extends State<Victory> {
void initState() {
animation.start();
animation.addStatusListener((status) {
if (status == AnimationStatus.completed) {
setState(() {});
}
if (status == AnimationStatus.completed) {}
});
super.initState();