WT1.1.18+8 repeats MAX

This commit is contained in:
bossanyit 2021-06-07 17:28:25 +02:00
parent f5ef0ed9ce
commit a8728edae2
10 changed files with 73 additions and 44 deletions

View File

@ -352,7 +352,7 @@
"Start training": "Start training",
"Enjoy the exercises, good luck with the testing!": "Enjoy the exercises, good luck with the testing!",
"Please continue with the next exercise in the queue:": "Please continue with the next exercise in the queue:",
"Or, you can redifine this exercise queue in the Compact Test menu": "Or, you can redifine this exercise queue in the Compact Test menu",
"Or, you can redefine this exercise queue in the Compact Test menu": "Or, you can redifine this exercise queue in the Compact Test menu",
"you are able to do 12-20 repeats with": "you are able to do 12-20 repeats with",
"You have an active Test Set!": "You have an active Test Set!",
"Do you want to override it?": "Do you want to override it?",
@ -462,5 +462,12 @@
"This is a premium function": "This is a premium function",
"because only that way can we show you your exercises, results and evaluations.": "because only that way can we show you your exercises, results and evaluations.",
"because only that way can we show you the personalized development diagrams and analysises": "because only that way can we show you the personalized development diagrams and analysises",
"because only in that way can you begin to execute a training plan": "because only in that way can you begin to execute a training plan"
"because only in that way can you begin to execute a training plan": "because only in that way can you begin to execute a training plan",
"Please try to execute this exercise with exact weight and repeats what is suggested": "Please try to execute this exercise with exact weight and repeats what is suggested",
"Please try to execute this exercise with exact repeats what is suggested": "Please try to execute this exercise with exact repeats what is suggested",
"Please take a relative bigger weight and at least 12 times and do your best! MAXIMIZE it!": "Please take a relative bigger weight and at least 12 times and do your best! MAXIMIZE it!",
"During the exercise you should try your best:": "During the exercise you should try your best:",
"do it with the possible maximum repeats.": "do it with the possible maximum repeats.",
"Maximum repeats": "Maximum repeats",
"TEST": "TEST"
}

View File

@ -355,7 +355,7 @@
"Start training": "Edzés kezdése",
"Enjoy the exercises, good luck with the testing!": "Élvezd a gyakorlatokat, sok sikert a teszteléshez!",
"Please continue with the next exercise in the queue:": "Kérlek folytasd a következő gyakorlattal:",
"Or, you can redifine this exercise queue in the Compact Test menu": "Vagy változtatsd meg a gyakorlatokat a Tesztközpontban",
"Or, you can redefine this exercise queue in the Compact Test menu": "Vagy változtatsd meg a gyakorlatokat a Tesztközpontban",
"you are able to do 12-20 repeats with": "amivel képes vagy 12-20 ismétlésre",
"You have an active Test Set!": "Van egy aktiv tesztköröd!",
"Do you want to override it?": "Felülírod?",
@ -460,5 +460,12 @@
"This is a premium function": "Ez egy prémium funkció",
"because only that way can we show you your exercises, results and evaluations.": "mert csak így tudjuk neked megmutatni a korábbi gyakorlataidat, eredményeket és kiértékeléseket.",
"because only that way can we show you the personalized development diagrams and analysises": "mert csak így tudjuk neked megmutatni a személyre szabott diagramokat és analíziseket.",
"because only in that way can you begin to execute a training plan": "mert csak így tudod elkezdeni az edzésterved végrehajtását"
"because only in that way can you begin to execute a training plan": "mert csak így tudod elkezdeni az edzésterved végrehajtását",
"Please try to execute this exercise with exact weight and repeats what is suggested": "Kérlek, próbáld végrehajtani a gyakorlatot pontosan annyi súllyal és ismétléssel, amennyit javaslunk",
"Please try to execute this exercise with exact repeats what is suggested": "Kérlek, próbáld végrehajtani a gyakorlatot pontosan annyi ismétléssel, amennyit javaslunk",
"Please take a relative bigger weight and at least 12 times and do your best! MAXIMIZE it!": "Kérlek válassz egy relatív nagyobb súlyt, és hajtsd végre a gyakorlatot minimum 12-szer! MAXOLD KI!",
"During the exercise you should try your best:": "A gyakorlat végrehajtása alatt a hozd a legjobbadat:",
"do it with the possible maximum repeats.": "A lehetséges maximum ismétlésszámot hajtsd végre.",
"Maximum repeats": "Maximum ismétlésszám",
"TEST": "TESZT"
}

View File

@ -388,7 +388,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 7;
CURRENT_PROJECT_VERSION = 8;
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 = 7;
CURRENT_PROJECT_VERSION = 8;
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 = 7;
CURRENT_PROJECT_VERSION = 8;
DEVELOPMENT_TEAM = SFJJBDCU6Z;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (

View File

@ -9,6 +9,7 @@ class TrainingPlan {
late String internalName;
late String description;
late bool free;
late bool active;
int? treeId;
HashMap<String, String> nameTranslations = HashMap();
@ -23,6 +24,7 @@ class TrainingPlan {
this.internalName = json['internalName'];
this.description = json['description'];
this.free = json['free'];
this.active = json['active'];
this.treeId = json['treeId'];
nameTranslations['en'] = name;
@ -62,6 +64,7 @@ class TrainingPlan {
"type": this.type,
"internalName": this.internalName,
"free": this.free,
"active": this.active,
"description": this.description,
"nameTranslation": this.nameTranslations.toString(),
};

View File

@ -77,10 +77,14 @@ class TrainingPlanRepository {
detail.parallel = elem.parallel;
detail.restingTime = elem.restingTime;
detail.exerciseType = Cache().getExerciseTypeById(detail.exerciseTypeId!);
if (detail.exerciseType!.unitQuantityUnit != null) {
detail = getCalculatedWeightRepeats(elem.exerciseTypeId, detail);
if (elem.weight == -1) {
if (detail.exerciseType!.unitQuantityUnit != null) {
detail = getCalculatedWeightRepeats(elem.exerciseTypeId, detail);
} else {
detail.weight = 0;
}
} else {
detail.weight = 0;
detail.weight = elem.weight;
}
//print("Detail $detail exerciseType: ${detail.exerciseType}");

View File

@ -91,7 +91,15 @@ class PackageApi {
final Iterable json = jsonDecode(headRecord[1]);
final List<TrainingPlan>? plans = json.map((plan) => TrainingPlan.fromJson(plan)).toList();
Cache().setTrainingPlans(plans);
List<TrainingPlan> activePlans = [];
if (plans != null) {
plans.forEach((element) {
if (element.active) {
activePlans.add(element);
}
});
}
Cache().setTrainingPlans(activePlans);
} else if (headRecord[0] == "SplitTests") {
final Iterable json = jsonDecode(headRecord[1]);
final List<SplitTest>? tests = json.map((test) => SplitTest.fromJson(test)).toList();

View File

@ -373,7 +373,22 @@ class TrainingPlanActivatePage extends StatelessWidget with Trans {
})
},
onRepeatTap: () => {
print("Reps"),
showDialog(
context: context,
builder: (BuildContext context) {
return DialogCommon(
title: t("Maximum repeats"),
descriptions: t("During the exercise you should try your best:"),
description2: t("do it with the possible maximum repeats."),
text: "OK",
onTap: () => {
Navigator.of(context).pop(),
},
onCancel: () => {
Navigator.of(context).pop(),
},
);
})
}),
headerGridLinesVisibility: GridLinesVisibility.both,
gridLinesVisibility: GridLinesVisibility.both,

View File

@ -454,7 +454,6 @@ class _ExerciseListState extends State<ExerciseList> with Trans {
title = AppLocalizations.of(context)!.translate("Stop!");
description = AppLocalizations.of(context)!.translate("Please continue with the next exercise in the queue:") +
next.exerciseType!.nameTranslation;
description2 = AppLocalizations.of(context)!.translate("Or, you can redifine this exercise queue in the Compact Test menu");
} else {
final HashMap args = HashMap();
args['exerciseType'] = next.exerciseType;
@ -564,13 +563,17 @@ class _ExerciseTileState extends State<ExerciseTile> with Trans {
final bool done = state.equalsTo(ExercisePlanDetailState.finished) || state.equalsTo(ExercisePlanDetailState.skipped);
final String countSerie = widget.detail.set.toString();
final String step = (widget.detail.exercises.length).toString();
String weight = widget.detail.weight!.toStringAsFixed(1);
String weight = widget.detail.weight != null ? widget.detail.weight!.toStringAsFixed(1) : "-";
String restingTime = widget.detail.restingTime == null ? "" : widget.detail.restingTime!.toStringAsFixed(0);
bool isTest = false;
if (widget.detail.weight! == -1) {
if (widget.detail.weight != null && widget.detail.weight! == -1) {
weight = t("TEST");
isTest = true;
}
String repeats = widget.detail.repeats!.toString();
if (widget.detail.repeats! == -1) {
repeats = t("MAX");
}
setContext(context);
return Container(
color: Colors.transparent,
@ -679,7 +682,7 @@ class _ExerciseTileState extends State<ExerciseTile> with Trans {
style: GoogleFonts.inter(
fontSize: 12, color: done ? Colors.grey[100] : Colors.yellow[400], fontWeight: FontWeight.bold)),
TextSpan(
text: widget.detail.repeats!.toString(),
text: repeats,
style: GoogleFonts.inter(
fontSize: 12,
)),
@ -707,19 +710,6 @@ class _ExerciseTileState extends State<ExerciseTile> with Trans {
style: GoogleFonts.inter(fontSize: 12, color: done ? Colors.grey[100] : Colors.white, fontWeight: FontWeight.bold)),
]),
)),
/* done
? AnimatedBuilder(
animation: animation,
builder: (context, snapshot) {
return Column(mainAxisAlignment: MainAxisAlignment.center, children: [
Image.asset(
"asset/image/kupa.png",
width: animation.value,
),
Text("Result", style: GoogleFonts.inter(fontSize: 10, color: Colors.white)),
]);
})
: Offstage(), */
isTest
? AnimatedBuilder(
animation: animation,

View File

@ -1,15 +1,8 @@
import 'dart:collection';
import 'package:aitrainer_app/bloc/test_set_control/test_set_control_bloc.dart';
import 'package:aitrainer_app/bloc/test_set_execute/test_set_execute_bloc.dart';
import 'package:aitrainer_app/bloc/test_set_new/test_set_new_bloc.dart';
import 'package:aitrainer_app/bloc/training_plan/training_plan_bloc.dart';
import 'package:aitrainer_app/library/custom_icon_icons.dart';
import 'package:aitrainer_app/model/cache.dart';
import 'package:aitrainer_app/model/customer_training_plan_details.dart';
import 'package:aitrainer_app/model/exercise_plan_detail.dart';
import 'package:aitrainer_app/model/exercise_type.dart';
import 'package:aitrainer_app/util/trans.dart';
import 'package:aitrainer_app/widgets/app_bar.dart';
import 'package:aitrainer_app/widgets/exercise_save.dart';
@ -37,9 +30,7 @@ class TrainingPlanExercise extends StatelessWidget with Trans {
padding: EdgeInsets.all(20),
decoration: BoxDecoration(
image: DecorationImage(
image: Cache().userLoggedIn!.sex == "m"
? AssetImage("asset/image/WT_black_background.jpg")
: AssetImage("asset/image/WT_Results_for_female.jpg"),
image: AssetImage("asset/image/WT_black_background.jpg"),
fit: BoxFit.cover,
alignment: Alignment.center,
),
@ -77,21 +68,25 @@ class TrainingPlanExercise extends StatelessWidget with Trans {
Widget getExercises(TrainingPlanBloc bloc, CustomerTrainingPlanDetails detail) {
final String noTestTextWithWeight = "Please try to execute this exercise with exact weight and repeats what is suggested";
final String noTestTextNoWeight = "Please try to execute this exercise with exact repeats what is suggested";
final String testMaxRepeats = "Please repeat as much times as you can! MAXIMIZE it!";
final String testWeight = "Please take a relative bigger weight and at least 12 times and do your best! MAXIMIZE it!";
return ExerciseSave(
exerciseName: detail.exerciseType!.nameTranslation,
exerciseDescription: detail.exerciseType!.descriptionTranslation,
exerciseTask: detail.exerciseType!.unitQuantityUnit != null
? detail.weight == -1
? t("Please take a relative bigger weight and repeat 12-20 times and do your best! MAXIMIZE it!")
: noTestTextWithWeight
? t(testWeight)
: detail.repeats == -1
? t(testMaxRepeats)
: t(noTestTextWithWeight)
: detail.repeats == -1
? t("Please repeat as much times as you can! MAXIMIZE it!")
? t(testMaxRepeats)
: noTestTextNoWeight,
unit: detail.exerciseType!.unit,
unitQuantityUnit: detail.exerciseType!.unitQuantityUnit,
hasUnitQuantity: detail.exerciseType!.unitQuantityUnit != null,
weight: detail.weight == -1 ? 30 : detail.weight,
repeats: detail.repeats == -1 ? 12 : detail.repeats,
repeats: detail.repeats == -1 ? 99 : detail.repeats,
set: detail.set,
exerciseNr: detail.exercises.length + 1,
onUnitQuantityChanged: (value) => bloc.add(TrainingPlanWeightChange(weight: value, detail: detail)),

View File

@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.1.18+85
version: 1.1.18+86
environment:
sdk: ">=2.12.0 <3.0.0"