diff --git a/i18n/en.json b/i18n/en.json
index 29d0203..501cbfd 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -541,5 +541,8 @@
"Based on your initial data, we will generate the personalized training plan for you.": "Based on your initial data, we will generate the personalized training plan for you.",
"No selected Training Plan": "No selected Training Plan",
"Min. 10 minutes": "Min. 10 minutes",
- "You want to skip really the entire exercise?": "You want to skip really the entire exercise?"
+ "You want to skip really the entire exercise?": "You want to skip really the entire exercise?",
+ "Premium function": "Premium function",
+ "This is a premium function, you can reach it outside of the trial period only with a valid subscription": "This is a premium function, you can reach it outside of the trial period only with a valid subscription",
+ "This is a premium function, you can reach it only with a valid subscription": "This is a premium function, you can reach it only with a valid subscription"
}
\ No newline at end of file
diff --git a/i18n/hu.json b/i18n/hu.json
index c2c6777..09d2b32 100644
--- a/i18n/hu.json
+++ b/i18n/hu.json
@@ -541,5 +541,8 @@
"Based on your initial data, we will generate the personalized training plan for you.": "A megadott adataid alapján most személyre szabott edzéstervet generálunk neked.",
"No selected Training Plan": "Nincs kiválasztott edzésterved",
"Min. 10 minutes": "Minimum 10 perc",
- "You want to skip really the entire exercise?": "Átugrod az egész gyakorlatot?"
+ "You want to skip really the entire exercise?": "Átugrod az egész gyakorlatot?",
+ "Premium function": "Prémium tartalom",
+ "This is a premium function, you can reach it outside of the trial period only with a valid subscription": "Ezt a tartalmat az ingyenes időszakon kívül csak aktív előfizetéssel éred el",
+ "This is a premium function, you can reach it only with a valid subscription": "Ezt a tartalmat csak aktív előfizetéssel éred el"
}
\ No newline at end of file
diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj
index ac8d8ef..6e4f3a9 100644
--- a/ios/Runner.xcodeproj/project.pbxproj
+++ b/ios/Runner.xcodeproj/project.pbxproj
@@ -388,7 +388,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
- CURRENT_PROJECT_VERSION = 2;
+ 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 = 2;
+ 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 = 2;
+ CURRENT_PROJECT_VERSION = 5;
DEVELOPMENT_TEAM = SFJJBDCU6Z;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist
index 4f1e1fd..2d4236f 100644
--- a/ios/Runner/Info.plist
+++ b/ios/Runner/Info.plist
@@ -11,7 +11,7 @@
CFBundleInfoDictionaryVersion
6.0
CFBundleName
- WorkoutTest
+ Workout Test
CFBundlePackageType
APPL
CFBundleShortVersionString
diff --git a/lib/bloc/training_plan/training_plan_bloc.dart b/lib/bloc/training_plan/training_plan_bloc.dart
index 3b98ef1..5c734d4 100644
--- a/lib/bloc/training_plan/training_plan_bloc.dart
+++ b/lib/bloc/training_plan/training_plan_bloc.dart
@@ -18,6 +18,7 @@ import 'package:aitrainer_app/util/app_language.dart';
import 'package:aitrainer_app/util/common.dart';
import 'package:aitrainer_app/util/enums.dart';
import 'package:aitrainer_app/util/track.dart';
+import 'package:aitrainer_app/widgets/exercise_save.dart';
import 'package:bloc/bloc.dart';
import 'package:equatable/equatable.dart';
import 'package:flutter/material.dart';
@@ -74,15 +75,54 @@ class TrainingPlanBloc extends Bloc {
yield TrainingPlanExerciseLoading();
event.detail.weight = event.weight;
+ yield TrainingPlanExerciseReady();
+ yield TrainingPlanReady();
+ } else if (event is TrainingPlanWeightChangeUp) {
+ yield TrainingPlanExerciseLoading();
+ if (event.detail.weight != null) {
+ event.detail.repeats =
+ Common.reCalculateRepeatsByChangedWeight(event.detail.weight!, event.detail.repeats!.toDouble(), event.detail.weight! + 1);
+ event.detail.weight = event.detail.weight! + 1;
+ ExerciseSaveStream().weight = event.detail.weight!;
+ ExerciseSaveStream().repeats = event.detail.repeats!;
+ ExerciseSaveStream().getStreamController().add(true);
+ }
+
+ yield TrainingPlanExerciseReady();
+ yield TrainingPlanReady();
+ } else if (event is TrainingPlanWeightChangeDown) {
+ yield TrainingPlanExerciseLoading();
+ if (event.detail.weight != null) {
+ event.detail.repeats =
+ Common.reCalculateRepeatsByChangedWeight(event.detail.weight!, event.detail.repeats!.toDouble(), event.detail.weight! - 1);
+ event.detail.weight = event.detail.weight! - 1;
+ ExerciseSaveStream().weight = event.detail.weight!;
+ ExerciseSaveStream().repeats = event.detail.repeats!;
+ ExerciseSaveStream().getStreamController().add(true);
+ }
+
yield TrainingPlanExerciseReady();
yield TrainingPlanReady();
} else if (event is TrainingPlanWeightChangeRecalculate) {
yield TrainingPlanExerciseLoading();
- event.detail.repeats =
- Common.reCalculateRepeatsByChangedWeight(event.detail.weight!, event.detail.repeats!.toDouble(), event.weight);
- event.detail.weight = event.weight;
+ /* double weightFromPlan = trainingPlanRepository.getOriginalWeight(this.getMyPlan()!.trainingPlanId!, event.detail);
+ print("Plan Wieght: $weightFromPlan");
+ if (weightFromPlan != -1 || (weightFromPlan == -1 && event.detail.set! > 1)) {
+ bool isTest = weightFromPlan != -1 || weightFromPlan != -2;
+ if (!isTest || (isTest && event.detail.set! > 1)) {
+ //&& event.detail.exercises.length > 0
+ event.detail.repeats =
+ Common.reCalculateRepeatsByChangedWeight(event.detail.weight!, event.detail.repeats!.toDouble(), event.weight);
+ if (event.detail.repeats! < 3) {
+ event.detail.repeats = 4;
+ }
+ ExerciseSaveStream().repeats = event.detail.repeats!;
+ ExerciseSaveStream().getStreamController().add(true);
+ } */
+ event.detail.weight = event.weight;
+ yield TrainingPlanExerciseReady();
yield TrainingPlanReady();
} else if (event is TrainingPlanRepeatsChange) {
yield TrainingPlanExerciseLoading();
@@ -102,6 +142,7 @@ class TrainingPlanBloc extends Bloc {
yield TrainingPlanReady();
throw Exception("Please type your repeats!");
}
+ print("ExerciseTypeUID: ${event.detail.exerciseTypeId}");
if (event.detail.weight == -3) {
print("DropSet");
event.detail.state = ExercisePlanDetailState.finished;
@@ -123,8 +164,8 @@ class TrainingPlanBloc extends Bloc {
// recalculate the weight to the original planned repeats for the next details
if (exercise.unitQuantity != null && exercise.unitQuantity! > 0) {
for (var nextDetail in _myPlan!.details) {
- print("NextDetail detail: $nextDetail");
double weightFromPlan = trainingPlanRepository.getOriginalWeight(this.getMyPlan()!.trainingPlanId!, nextDetail);
+ print("NextDetail detail: $nextDetail *** PlanWeight: $weightFromPlan");
if (nextDetail.exerciseTypeId == event.detail.exerciseTypeId &&
nextDetail.weight == -2 &&
nextDetail.customerTrainingPlanDetailsId != event.detail.customerTrainingPlanDetailsId) {
@@ -136,6 +177,12 @@ class TrainingPlanBloc extends Bloc {
} else if (nextDetail.exerciseTypeId == event.detail.exerciseTypeId && nextDetail.weight == -1 && nextDetail.set! == 1) {
print("recalculating -1, set 1 ${event.detail.customerTrainingPlanDetailsId}");
nextDetail = trainingPlanRepository.recalculateDetailFixRepeatsSet1(_myPlan!.trainingPlanId!, nextDetail, event.detail);
+ } else if (nextDetail.exerciseTypeId == event.detail.exerciseTypeId &&
+ weightFromPlan == -2 &&
+ nextDetail.set! == 1 &&
+ nextDetail.exercises.length == 0) {
+ print("recalculating -1/ no exercise, set 1 ${event.detail.customerTrainingPlanDetailsId}");
+ nextDetail = trainingPlanRepository.recalculateDetailFixRepeatsSet1(_myPlan!.trainingPlanId!, nextDetail, event.detail);
}
}
}
diff --git a/lib/bloc/training_plan/training_plan_event.dart b/lib/bloc/training_plan/training_plan_event.dart
index 6d17338..f91b357 100644
--- a/lib/bloc/training_plan/training_plan_event.dart
+++ b/lib/bloc/training_plan/training_plan_event.dart
@@ -28,6 +28,22 @@ class TrainingPlanWeightChange extends TrainingPlanEvent {
List