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",
"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:",
"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ó",
"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:",
"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;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 3;
CURRENT_PROJECT_VERSION = 5;
DEVELOPMENT_TEAM = SFJJBDCU6Z;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
@ -531,7 +531,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 3;
CURRENT_PROJECT_VERSION = 5;
DEVELOPMENT_TEAM = SFJJBDCU6Z;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
@ -566,7 +566,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 3;
CURRENT_PROJECT_VERSION = 5;
DEVELOPMENT_TEAM = SFJJBDCU6Z;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (

View File

@ -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;
}

View File

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

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;

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)),
]),
)),
]),