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
@@ -58,13 +58,13 @@ class TrainingEvaluationBloc extends Bloc<TrainingEvaluationEvent, TrainingEvalu
}
trainingPlanBloc.getMyPlan()!.days[day]!.forEach((element) {
if (!element.state.equalsTo(ExercisePlanDetailState.extra)) {
if (!findExerciseInEvaluationList(element.exerciseTypeId!)) {
addEvaluationExercise(element);
} else {
//editEvaluationExercise(element);
}
//if (!element.state.equalsTo(ExercisePlanDetailState.extra)) {
if (!findExerciseInEvaluationList(element.exerciseTypeId!)) {
addEvaluationExercise(element);
} else {
//editEvaluationExercise(element);
}
//}
});
}
@@ -139,7 +139,7 @@ class TrainingEvaluationBloc extends Bloc<TrainingEvaluationEvent, TrainingEvalu
} else if (rate < 0.90) {
return Colors.red[900]!;
} else if (rate < 0.95) {
return Colors.green[400]!;
return Colors.red[400]!;
} else {
return Colors.white;
}
-1
View File
@@ -147,7 +147,6 @@ Future<Null> main() async {
print(" -- FireBase init..");
await FirebaseApi().initializeFlutterFire();
FlurryData.logEvent("enter_test");
runApp(MultiBlocProvider(
providers: [
+7 -3
View File
@@ -160,13 +160,17 @@ class TrainingPlanRepository {
return detail;
}
double oneRepMax = Common.calculate1RM(lastExercise1RM!.unitQuantity!, lastExercise1RM!.quantity!);
//double oneRepMax = Common.calculate1RM(lastExercise1RM!.unitQuantity!, lastExercise1RM!.quantity!);
//print("Exercise $exerciseTypeId - 1RM : $oneRepMax");
weight = oneRepMax * Common.get1RMPercent(detail.repeats!);
//weight = oneRepMax * Common.get1RMPercent(detail.repeats!);
//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);
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;
return detail;
+17 -13
View File
@@ -87,8 +87,8 @@ class TrainingEvaluationPage extends StatelessWidget with Trans {
SliverAppBar(
pinned: true,
backgroundColor: Colors.transparent,
expandedHeight: 100.0,
collapsedHeight: 100,
expandedHeight: 130.0,
collapsedHeight: 130,
toolbarHeight: 40,
automaticallyImplyLeading: false,
flexibleSpace: FlexibleSpaceBar(
@@ -302,6 +302,7 @@ class ExerciseTile extends StatelessWidget with Trans {
setContext(context);
bool hasWeight = exercise.type.equalsTo(TrainingEvaluationExerciseType.weightBased);
bool skipped = exercise.state.equalsTo(ExercisePlanDetailState.skipped);
bool extra = exercise.state.equalsTo(ExercisePlanDetailState.extra);
return Container(
color: Colors.transparent,
@@ -367,15 +368,18 @@ class ExerciseTile extends StatelessWidget with Trans {
TextSpan(text: "\n"),
hasWeight
? skipped
? TextSpan(
text: t("skipped") + "!",
style: GoogleFonts.inter(fontSize: 12, color: Colors.grey[400], fontWeight: FontWeight.bold))
? extra
? TextSpan(
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(
text: t("One Rep Max") + ": ",
style: GoogleFonts.inter(fontSize: 12, color: Colors.yellow[400], fontWeight: FontWeight.bold))
: TextSpan(),
hasWeight
? skipped
? skipped || extra
? TextSpan()
: TextSpan(
text: exercise.oneRepMax!.toStringAsFixed(0) +
@@ -390,14 +394,14 @@ class ExerciseTile extends StatelessWidget with Trans {
: TextSpan(),
TextSpan(text: "\n"),
hasWeight
? skipped
? skipped || extra
? TextSpan()
: TextSpan(
text: t("Total Lift") + ": ",
style: GoogleFonts.inter(fontSize: 12, color: Colors.yellow[400], fontWeight: FontWeight.bold))
: TextSpan(),
hasWeight
? skipped
? skipped || extra
? TextSpan()
: TextSpan(
text: exercise.totalLift!.toStringAsFixed(0) +
@@ -409,7 +413,7 @@ class ExerciseTile extends StatelessWidget with Trans {
t("kg") +
")",
style: GoogleFonts.inter(fontSize: 12, color: Colors.white, fontWeight: FontWeight.bold))
: skipped
: skipped || extra
? TextSpan()
: TextSpan(
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)),
TextSpan(text: "\n"),
skipped
skipped || extra
? TextSpan()
: TextSpan(
text: t("Trend") + ": ",
style: GoogleFonts.inter(fontSize: 12, color: Colors.yellow[400], fontWeight: FontWeight.bold)),
skipped
skipped || extra
? TextSpan()
: TextSpan(
text: exercise.trendText,
style: GoogleFonts.inter(fontSize: 12, color: Colors.white, fontWeight: FontWeight.bold)),
text: t(exercise.trendText),
style: GoogleFonts.inter(fontSize: 12, color: exercise.trendColor, fontWeight: FontWeight.bold)),
]),
)),
]),