WT 1.1.14 Tutorial, Sports, New goals
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'dart:async';
|
||||
import 'dart:collection';
|
||||
|
||||
import 'package:aitrainer_app/bloc/tutorial/tutorial_bloc.dart';
|
||||
import 'package:aitrainer_app/model/cache.dart';
|
||||
import 'package:aitrainer_app/model/exercise_ability.dart';
|
||||
import 'package:aitrainer_app/model/workout_menu_tree.dart';
|
||||
@@ -26,11 +27,6 @@ class MenuBloc extends Bloc<MenuEvent, MenuState> with Trans, Logging {
|
||||
WorkoutMenuTree? workoutItem;
|
||||
final List<int> listFilterDevice = [];
|
||||
|
||||
String infoTitle = "";
|
||||
String infoText = "";
|
||||
String infoText2 = "";
|
||||
String infoText3 = "";
|
||||
String infoLink = "";
|
||||
int missingParent = 0;
|
||||
String? missingTreeName = "";
|
||||
|
||||
@@ -42,48 +38,6 @@ class MenuBloc extends Bloc<MenuEvent, MenuState> with Trans, Logging {
|
||||
parent = 0;
|
||||
}
|
||||
|
||||
void setMenuInfo() {
|
||||
double percent = Cache().getPercentExercises();
|
||||
if (percent == -1) {
|
||||
exerciseRepository.getBaseExerciseFinishedPercent();
|
||||
percent = Cache().getPercentExercises();
|
||||
}
|
||||
|
||||
percent = percent * 100;
|
||||
//log("Percent " + percent.toString());
|
||||
if (percent == -1 || percent == 0) {
|
||||
infoTitle = t("Greetings!");
|
||||
infoText = t("The purpose is to measure you physical condition") +
|
||||
" " +
|
||||
t("The suggested order of the exercises: chest - biceps - triceps - back - shoulders - core - tigh - calf.");
|
||||
infoText2 = t("I suggest begin your tests with a");
|
||||
infoText3 = t("Go to the menu Strength - One Rep Max - Chest, and select your favourite exercise.");
|
||||
infoLink = t("Bring me there");
|
||||
} else if (percent > 0 && percent < 20) {
|
||||
infoTitle = t("Nice! This is a good start");
|
||||
} else if (percent > 20 && percent < 40) {
|
||||
infoTitle = t("Go on!") + " " + t("You are on track");
|
||||
} else if (percent > 60 && percent < 80) {
|
||||
infoTitle = t("Persistence!") + " " + t("Not so much left");
|
||||
} else if (percent > 80 && percent < 100) {
|
||||
infoTitle = t("Almost!") + " " + t("You have only 1-2 exercise left to finish!");
|
||||
} else {
|
||||
infoTitle = t("Congratulation!");
|
||||
infoText2 = t("You have achieved to first 100% test-round!");
|
||||
infoText3 = t("Now you unlocked: Development By Muscles and the Suggested Trainings Plan");
|
||||
}
|
||||
|
||||
menuTreeRepository.sortByMuscleType();
|
||||
missingTreeName = exerciseRepository.nextMissingBaseExercise(menuTreeRepository.sortedTree);
|
||||
//log("Missing " + missingTreeName);
|
||||
if (missingTreeName != null) {
|
||||
if (percent > 0) {
|
||||
infoText = t("Please continue your tests with a") + " '" + missingTreeName! + "' " + t("exercise!");
|
||||
infoLink = t("Bring me there");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void setContext(BuildContext context) {
|
||||
this.context = context;
|
||||
}
|
||||
@@ -118,7 +72,6 @@ class MenuBloc extends Bloc<MenuEvent, MenuState> with Trans, Logging {
|
||||
final LinkedHashMap<String, WorkoutMenuTree> branch = menuTreeRepository.getBranch(event.parent);
|
||||
|
||||
await getImages(branch);
|
||||
//await Future.delayed(Duration(seconds: 2));
|
||||
yield MenuReady();
|
||||
} else if (event is MenuTreeUp) {
|
||||
yield MenuLoading();
|
||||
|
||||
Reference in New Issue
Block a user