WT1.1.23 TrainingPlans generation extension, minor fixes

This commit is contained in:
bossanyit
2021-09-11 07:42:10 +02:00
parent 4e9afbd4b3
commit cc836605fa
28 changed files with 236 additions and 96 deletions
+20 -15
View File
@@ -12,7 +12,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:modal_progress_hud_nsn/modal_progress_hud_nsn.dart';
enum Goals { gain_muscle, weight_loss, endurance, muscle_endurance, flexibility, gain_strength, explosiveness, shape_forming }
enum Goals { gain_muscle, muscle_endurance, gain_strength, shape_forming } //weight_loss, endurance, explosiveness,flexibility,
extension GoalsExt on Goals {
String toStr() => this.toString().split(".").last;
@@ -21,20 +21,13 @@ extension GoalsExt on Goals {
String description(Goals goal) {
switch (goal) {
case Goals.endurance:
return "Endurance";
case Goals.weight_loss:
return "Loss Weight";
case Goals.gain_muscle:
return "Gain Muscle";
case Goals.gain_strength:
return "Gain Strength";
case Goals.muscle_endurance:
return "Muscle Endurance";
case Goals.flexibility:
return "Flexibility";
case Goals.explosiveness:
return "Explosiveness";
case Goals.shape_forming:
return "Shape Forming";
default:
@@ -42,6 +35,18 @@ extension GoalsExt on Goals {
}
}
/*
case Goals.endurance:
return "Endurance";
case Goals.weight_loss:
return "Loss Weight";
case Goals.explosiveness:
return "Explosiveness";
case Goals.flexibility:
return "Flexibility";
*/
Goals getGoal(Goals goal) {
Goals selected = Goals.gain_muscle;
Goals.values.forEach((element) {
@@ -186,18 +191,18 @@ class _CustomerGoalPage extends State<CustomerGoalPage> with Trans {
SizedBox(
height: h,
),
getItem(changeBloc, Goals.weight_loss),
/* getItem(changeBloc, Goals.weight_loss),
SizedBox(
height: h,
),
), */
getItem(changeBloc, Goals.shape_forming),
SizedBox(
height: h,
),
getItem(changeBloc, Goals.endurance),
/* getItem(changeBloc, Goals.endurance),
SizedBox(
height: h,
),
), */
getItem(changeBloc, Goals.gain_strength),
SizedBox(
height: h,
@@ -206,14 +211,14 @@ class _CustomerGoalPage extends State<CustomerGoalPage> with Trans {
SizedBox(
height: h,
),
getItem(changeBloc, Goals.flexibility),
/* getItem(changeBloc, Goals.flexibility),
SizedBox(
height: h,
),
getItem(changeBloc, Goals.explosiveness),
SizedBox(
height: h,
),
), */
],
),
));
+23 -20
View File
@@ -37,7 +37,29 @@ class _CustomerWelcomePageState extends State<CustomerWelcomePage> with Trans {
child: Column(
children: [
SizedBox(
height: 200,
height: 5,
),
FadeIn(
child: Container(
width: 160,
height: 80,
child: GestureDetector(
onTap: () => Navigator.of(context).popAndPushNamed("home"),
child: Stack(
alignment: Alignment.center,
children: [
Image.asset('asset/icon/gomb_orange_c.png', width: 140, height: 80),
Text(
t("Next"),
style: GoogleFonts.archivoBlack(fontSize: 20, color: Colors.white),
),
],
),
)),
duration: Duration(seconds: 6),
),
SizedBox(
height: 110,
),
CircularPercentIndicator(
radius: 250.0,
@@ -75,25 +97,6 @@ class _CustomerWelcomePageState extends State<CustomerWelcomePage> with Trans {
SizedBox(
height: 90,
),
FadeIn(
child: Container(
width: 160,
height: 80,
child: GestureDetector(
onTap: () => Navigator.of(context).popAndPushNamed("home"),
child: Stack(
alignment: Alignment.center,
children: [
Image.asset('asset/icon/gomb_orange_a.png', width: 140, height: 80),
Text(
t("Next"),
style: GoogleFonts.archivoBlack(fontSize: 20, color: Colors.white),
),
],
),
)),
duration: Duration(seconds: 6),
),
],
),
))),
+11
View File
@@ -87,6 +87,7 @@ class SettingsPage extends StatelessWidget with Trans {
getPrivacy(),
mailTo(),
getVersion(),
//welcome(),
//getDevice(settingsBloc),
]);
}
@@ -264,6 +265,16 @@ class SettingsPage extends StatelessWidget with Trans {
);
}
ListTile welcome() {
return ListTile(
title: TextButton(
child: Text("Welcome"),
onPressed: () => {
Navigator.of(context).pushNamed("customerWelcomePage"),
}),
);
}
ListTile mailTo() {
return ListTile(
leading: Icon(CustomIcon.mail_1),
+5 -4
View File
@@ -308,6 +308,7 @@ class _ExerciseListState extends State<ExerciseList> with Trans {
void animate() {
offset = widget.bloc.getOffset();
print("Offset: $offset");
if (scrollController.hasClients) {
scrollController.animateTo(offset, duration: Duration(milliseconds: 300), curve: Curves.easeIn);
}
@@ -531,8 +532,8 @@ class ExerciseTile extends StatelessWidget with Trans {
elevation: 0,
padding: EdgeInsets.all(0),
position: BadgePosition.topStart(top: 5, start: 5),
animationDuration: Duration(milliseconds: 500),
animationType: BadgeAnimationType.slide,
animationDuration: Duration(milliseconds: 1000),
animationType: BadgeAnimationType.scale,
badgeColor: Colors.transparent,
showBadge: true,
badgeContent: IconButton(
@@ -638,7 +639,7 @@ class ExerciseTile extends StatelessWidget with Trans {
useRootNavigator: true,
context: context,
builder: (_) => CupertinoAlertDialog(
title: Text(t("You want to skip really this exercise?")),
title: Text(t("You want to skip really the entire exercise?")),
content: Column(children: [
Divider(),
]),
@@ -652,7 +653,7 @@ class ExerciseTile extends StatelessWidget with Trans {
child: Text(t("Yes")),
onPressed: () {
Navigator.pop(context);
bloc.add(TrainingPlanSkipExercise(detail: detail));
bloc.add(TrainingPlanSkipEntireExercise(detail: detail));
},
)
],
+1
View File
@@ -86,6 +86,7 @@ class MyTrainingPlans extends StatelessWidget with Trans, Logging {
getTrainingPlan(t("Training Plans for Women"), "asset/menu/training_plans_q_woman.jpg", "for_woman"),
getTrainingPlan(t("Training Plans of Celebrities"), "asset/menu/training_plans_q_celebrities.jpg", "celebrities"),
getTrainingPlan(t("Training Plans for Gain Strength"), "asset/menu/training_plans_q_gain_strength.jpg", "gain_strength"),
getTrainingPlan(t("Training Plans for Muscle Endurance"), "asset/menu/strenght_endurance.jpg", "muscle_endurance"),
getTrainingPlan(t("Physical Prepare Program for Footgolfers"), "asset/menu/FG_2_edz.jpg", "footgolf"),
]),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(