WT 1.1.20+5 training plan fixes

This commit is contained in:
bossanyit 2021-07-06 16:44:21 +02:00
parent 48a0c3f7de
commit 67924cf0a2
7 changed files with 38 additions and 29 deletions

View File

@ -507,5 +507,6 @@
"Register": "Sign Up", "Register": "Sign Up",
"Reach all basic functions, suggestions and": "Reach all basic functions, suggestions and", "Reach all basic functions, suggestions and": "Reach all basic functions, suggestions and",
"optimized training plans, customized to your fitness state and strength:": "optimized training plans, customized to your fitness state and strength:", "optimized training plans, customized to your fitness state and strength:": "optimized training plans, customized to your fitness state and strength:",
"Soon! Check back later for the plan details": "Soon! Check back later for the plan details" "Soon! Check back later for the plan details": "Soon! Check back later for the plan details",
"mins": "mins"
} }

View File

@ -505,5 +505,6 @@
"Register": "Regisztráció", "Register": "Regisztráció",
"Reach all basic functions, suggestions and": "Kattints a regisztrációra, hogy elérd az alap funkciókat, javaslatokat,", "Reach all basic functions, suggestions and": "Kattints a regisztrációra, hogy elérd az alap funkciókat, javaslatokat,",
"optimized training plans, customized to your fitness state and strength:": "optiomalizált edzés terveket, amelyeket a te erő- és fitnesz állapododra szabunk:", "optimized training plans, customized to your fitness state and strength:": "optiomalizált edzés terveket, amelyeket a te erő- és fitnesz állapododra szabunk:",
"Soon! Check back later for the plan details": "Nemsokára! Nézz vissza később, amikor már aktiváltuk az edzésterv részleteit" "Soon! Check back later for the plan details": "Nemsokára! Nézz vissza később, amikor már aktiváltuk az edzésterv részleteit",
"mins": "perc"
} }

View File

@ -388,7 +388,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 3; CURRENT_PROJECT_VERSION = 5;
DEVELOPMENT_TEAM = SFJJBDCU6Z; DEVELOPMENT_TEAM = SFJJBDCU6Z;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
@ -531,7 +531,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 3; CURRENT_PROJECT_VERSION = 5;
DEVELOPMENT_TEAM = SFJJBDCU6Z; DEVELOPMENT_TEAM = SFJJBDCU6Z;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
@ -566,7 +566,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 3; CURRENT_PROJECT_VERSION = 5;
DEVELOPMENT_TEAM = SFJJBDCU6Z; DEVELOPMENT_TEAM = SFJJBDCU6Z;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (

View File

@ -58,13 +58,13 @@ class TrainingEvaluationBloc extends Bloc<TrainingEvaluationEvent, TrainingEvalu
} }
trainingPlanBloc.getMyPlan()!.days[day]!.forEach((element) { trainingPlanBloc.getMyPlan()!.days[day]!.forEach((element) {
if (!element.state.equalsTo(ExercisePlanDetailState.extra)) { //if (!element.state.equalsTo(ExercisePlanDetailState.extra)) {
if (!findExerciseInEvaluationList(element.exerciseTypeId!)) { if (!findExerciseInEvaluationList(element.exerciseTypeId!)) {
addEvaluationExercise(element); addEvaluationExercise(element);
} else { } else {
//editEvaluationExercise(element); //editEvaluationExercise(element);
}
} }
//}
}); });
} }
@ -139,7 +139,7 @@ class TrainingEvaluationBloc extends Bloc<TrainingEvaluationEvent, TrainingEvalu
} else if (rate < 0.90) { } else if (rate < 0.90) {
return Colors.red[900]!; return Colors.red[900]!;
} else if (rate < 0.95) { } else if (rate < 0.95) {
return Colors.green[400]!; return Colors.red[400]!;
} else { } else {
return Colors.white; return Colors.white;
} }

View File

@ -147,7 +147,6 @@ Future<Null> main() async {
print(" -- FireBase init.."); print(" -- FireBase init..");
await FirebaseApi().initializeFlutterFire(); await FirebaseApi().initializeFlutterFire();
FlurryData.logEvent("enter_test");
runApp(MultiBlocProvider( runApp(MultiBlocProvider(
providers: [ providers: [

View File

@ -160,13 +160,17 @@ class TrainingPlanRepository {
return detail; return detail;
} }
double oneRepMax = Common.calculate1RM(lastExercise1RM!.unitQuantity!, lastExercise1RM!.quantity!); //double oneRepMax = Common.calculate1RM(lastExercise1RM!.unitQuantity!, lastExercise1RM!.quantity!);
//print("Exercise $exerciseTypeId - 1RM : $oneRepMax"); //print("Exercise $exerciseTypeId - 1RM : $oneRepMax");
weight = oneRepMax * Common.get1RMPercent(detail.repeats!); //weight = oneRepMax * Common.get1RMPercent(detail.repeats!);
//print("Exercise $exerciseTypeId - weight : $weight"); //print("Exercise $exerciseTypeId - weight : $weight");
//weight = Common.roundWeight(weight);
//detail.weight = Common.calculateWeigthByChangedQuantity(detail.weight!, detail.repeats!.toDouble(), lastExercise1RM!.quantity!);
weight = lastExercise1RM!.unitQuantity! * detail.repeats! / lastExercise1RM!.quantity!;
weight = Common.roundWeight(weight); weight = Common.roundWeight(weight);
print("Recaluclated weight ${detail.weight} - repeat: ${detail.repeats}");
detail.repeats = Common.calculateQuantityByChangedWeight(oneRepMax, weight, detail.repeats!.toDouble()); //detail.repeats = Common.calculateQuantityByChangedWeight(oneRepMax, weight, detail.repeats!.toDouble());
detail.weight = weight; detail.weight = weight;
return detail; return detail;

View File

@ -87,8 +87,8 @@ class TrainingEvaluationPage extends StatelessWidget with Trans {
SliverAppBar( SliverAppBar(
pinned: true, pinned: true,
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
expandedHeight: 100.0, expandedHeight: 130.0,
collapsedHeight: 100, collapsedHeight: 130,
toolbarHeight: 40, toolbarHeight: 40,
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
flexibleSpace: FlexibleSpaceBar( flexibleSpace: FlexibleSpaceBar(
@ -302,6 +302,7 @@ class ExerciseTile extends StatelessWidget with Trans {
setContext(context); setContext(context);
bool hasWeight = exercise.type.equalsTo(TrainingEvaluationExerciseType.weightBased); bool hasWeight = exercise.type.equalsTo(TrainingEvaluationExerciseType.weightBased);
bool skipped = exercise.state.equalsTo(ExercisePlanDetailState.skipped); bool skipped = exercise.state.equalsTo(ExercisePlanDetailState.skipped);
bool extra = exercise.state.equalsTo(ExercisePlanDetailState.extra);
return Container( return Container(
color: Colors.transparent, color: Colors.transparent,
@ -367,15 +368,18 @@ class ExerciseTile extends StatelessWidget with Trans {
TextSpan(text: "\n"), TextSpan(text: "\n"),
hasWeight hasWeight
? skipped ? skipped
? TextSpan( ? extra
text: t("skipped") + "!", ? TextSpan(
style: GoogleFonts.inter(fontSize: 12, color: Colors.grey[400], fontWeight: FontWeight.bold)) text: "-", style: GoogleFonts.inter(fontSize: 12, color: Colors.grey[400], fontWeight: FontWeight.bold))
: TextSpan(
text: t("skipped") + "!",
style: GoogleFonts.inter(fontSize: 12, color: Colors.grey[400], fontWeight: FontWeight.bold))
: TextSpan( : TextSpan(
text: t("One Rep Max") + ": ", text: t("One Rep Max") + ": ",
style: GoogleFonts.inter(fontSize: 12, color: Colors.yellow[400], fontWeight: FontWeight.bold)) style: GoogleFonts.inter(fontSize: 12, color: Colors.yellow[400], fontWeight: FontWeight.bold))
: TextSpan(), : TextSpan(),
hasWeight hasWeight
? skipped ? skipped || extra
? TextSpan() ? TextSpan()
: TextSpan( : TextSpan(
text: exercise.oneRepMax!.toStringAsFixed(0) + text: exercise.oneRepMax!.toStringAsFixed(0) +
@ -390,14 +394,14 @@ class ExerciseTile extends StatelessWidget with Trans {
: TextSpan(), : TextSpan(),
TextSpan(text: "\n"), TextSpan(text: "\n"),
hasWeight hasWeight
? skipped ? skipped || extra
? TextSpan() ? TextSpan()
: TextSpan( : TextSpan(
text: t("Total Lift") + ": ", text: t("Total Lift") + ": ",
style: GoogleFonts.inter(fontSize: 12, color: Colors.yellow[400], fontWeight: FontWeight.bold)) style: GoogleFonts.inter(fontSize: 12, color: Colors.yellow[400], fontWeight: FontWeight.bold))
: TextSpan(), : TextSpan(),
hasWeight hasWeight
? skipped ? skipped || extra
? TextSpan() ? TextSpan()
: TextSpan( : TextSpan(
text: exercise.totalLift!.toStringAsFixed(0) + text: exercise.totalLift!.toStringAsFixed(0) +
@ -409,7 +413,7 @@ class ExerciseTile extends StatelessWidget with Trans {
t("kg") + t("kg") +
")", ")",
style: GoogleFonts.inter(fontSize: 12, color: Colors.white, fontWeight: FontWeight.bold)) style: GoogleFonts.inter(fontSize: 12, color: Colors.white, fontWeight: FontWeight.bold))
: skipped : skipped || extra
? TextSpan() ? TextSpan()
: TextSpan( : TextSpan(
text: exercise.repeats!.toStringAsFixed(0) + text: exercise.repeats!.toStringAsFixed(0) +
@ -422,16 +426,16 @@ class ExerciseTile extends StatelessWidget with Trans {
")", ")",
style: GoogleFonts.inter(fontSize: 12, color: Colors.white, fontWeight: FontWeight.bold)), style: GoogleFonts.inter(fontSize: 12, color: Colors.white, fontWeight: FontWeight.bold)),
TextSpan(text: "\n"), TextSpan(text: "\n"),
skipped skipped || extra
? TextSpan() ? TextSpan()
: TextSpan( : TextSpan(
text: t("Trend") + ": ", text: t("Trend") + ": ",
style: GoogleFonts.inter(fontSize: 12, color: Colors.yellow[400], fontWeight: FontWeight.bold)), style: GoogleFonts.inter(fontSize: 12, color: Colors.yellow[400], fontWeight: FontWeight.bold)),
skipped skipped || extra
? TextSpan() ? TextSpan()
: TextSpan( : TextSpan(
text: exercise.trendText, text: t(exercise.trendText),
style: GoogleFonts.inter(fontSize: 12, color: Colors.white, fontWeight: FontWeight.bold)), style: GoogleFonts.inter(fontSize: 12, color: exercise.trendColor, fontWeight: FontWeight.bold)),
]), ]),
)), )),
]), ]),