WT1.1.10+5 bugfix
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'dart:async';
|
||||
import 'dart:collection';
|
||||
|
||||
import 'package:aitrainer_app/model/cache.dart';
|
||||
import 'package:aitrainer_app/util/app_language.dart';
|
||||
import 'package:aitrainer_app/model/exercise.dart';
|
||||
import 'package:aitrainer_app/model/workout_menu_tree.dart';
|
||||
@@ -113,6 +114,9 @@ class GroupDate extends GroupData with Calculate, Common {
|
||||
|
||||
@override
|
||||
void temp2Output(Exercise exercise) {
|
||||
if (exercise.unitQuantity == null) {
|
||||
return;
|
||||
}
|
||||
Exercise newExercise = exercise.copy();
|
||||
newExercise.datePart = _origDatePart;
|
||||
if (this.diagramType == DiagramType.oneRepMax || this.diagramType == DiagramType.percent) {
|
||||
@@ -284,9 +288,7 @@ class DevelopmentByMuscleBloc extends Bloc<DevelopmentByMuscleEvent, Development
|
||||
double basePercent = 0;
|
||||
|
||||
@override
|
||||
DevelopmentByMuscleBloc({this.workoutTreeRepository}) : super(DevelopmentByMuscleStateInitial()) {
|
||||
Track().track(TrackingEvent.my_muscle_development);
|
||||
}
|
||||
DevelopmentByMuscleBloc({this.workoutTreeRepository}) : super(DevelopmentByMuscleStateInitial());
|
||||
|
||||
Future<void> getData() async {
|
||||
workoutTreeRepository.sortedTree = null;
|
||||
@@ -365,6 +367,8 @@ class DevelopmentByMuscleBloc extends Bloc<DevelopmentByMuscleEvent, Development
|
||||
try {
|
||||
if (event is DevelopmentByMuscleLoad) {
|
||||
yield DevelopmentByMuscleLoadingState();
|
||||
Track().track(TrackingEvent.my_muscle_development);
|
||||
Cache().setMuscleDevelopmentSeen();
|
||||
await getData();
|
||||
yield DevelopmentByMuscleReadyState();
|
||||
} else if (event is DevelopmentByMuscleDiagramTypeChange) {
|
||||
|
||||
@@ -81,7 +81,7 @@ class ExerciseControlBloc extends Bloc<ExerciseControlEvent, ExerciseControlStat
|
||||
}
|
||||
exerciseRepository.end = DateTime.now();
|
||||
await exerciseRepository.addExercise();
|
||||
exerciseRepository.initExercise();
|
||||
//exerciseRepository.initExercise();
|
||||
|
||||
step <= 3 ? timerBloc.add(TimerStart(duration: 300)) : timerBloc.add(TimerEnd());
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'dart:async';
|
||||
import 'package:aitrainer_app/model/cache.dart';
|
||||
import 'package:aitrainer_app/model/exercise.dart';
|
||||
import 'package:aitrainer_app/repository/exercise_repository.dart';
|
||||
import 'package:aitrainer_app/util/enums.dart';
|
||||
@@ -21,6 +22,7 @@ class ExerciseLogBloc extends Bloc<ExerciseLogEvent, ExerciseLogState> {
|
||||
try {
|
||||
if (event is ExerciseLogLoad) {
|
||||
yield ExerciseLogLoading();
|
||||
await Cache().setExerciseLogSeen();
|
||||
Track().track(TrackingEvent.exercise_log_open);
|
||||
yield ExerciseLogReady();
|
||||
} else if (event is ExerciseLogDelete) {
|
||||
|
||||
@@ -94,6 +94,7 @@ class ExerciseNewBloc extends Bloc<ExerciseNewEvent, ExerciseNewState> with Logg
|
||||
yield ExerciseNewReady();
|
||||
} else if (event is ExerciseNewQuantityUnitChange) {
|
||||
yield ExerciseNewLoading();
|
||||
log("Event quantityUnit " + event.quantity.toStringAsFixed(0));
|
||||
exerciseRepository.setUnitQuantity(event.quantity);
|
||||
unitQuantity = event.quantity;
|
||||
yield ExerciseNewReady();
|
||||
@@ -147,7 +148,7 @@ class ExerciseNewBloc extends Bloc<ExerciseNewEvent, ExerciseNewState> with Logg
|
||||
yield ExerciseNewLoading();
|
||||
exerciseRepository.end = DateTime.now();
|
||||
await exerciseRepository.addExercise();
|
||||
exerciseRepository.initExercise();
|
||||
// exerciseRepository.initExercise();
|
||||
menuBloc.add(MenuTreeDown(parent: 0));
|
||||
Cache().initBadges();
|
||||
Track().track(TrackingEvent.exercise_new, eventValue: exerciseRepository.exerciseType.name);
|
||||
|
||||
@@ -4,8 +4,6 @@ import 'package:aitrainer_app/bloc/account/account_bloc.dart';
|
||||
import 'package:aitrainer_app/model/cache.dart';
|
||||
import 'package:aitrainer_app/repository/customer_repository.dart';
|
||||
import 'package:aitrainer_app/repository/user_repository.dart';
|
||||
import 'package:aitrainer_app/service/exercise_tree_service.dart';
|
||||
import 'package:aitrainer_app/service/exercise_type_service.dart';
|
||||
import 'package:aitrainer_app/util/common.dart';
|
||||
import 'package:aitrainer_app/util/enums.dart';
|
||||
import 'package:aitrainer_app/util/track.dart';
|
||||
@@ -25,12 +23,7 @@ class LoginBloc extends Bloc<LoginEvent, LoginState> with Trans {
|
||||
final bool isRegistration;
|
||||
bool dataPolicyAllowed = false;
|
||||
bool obscure = true;
|
||||
LoginBloc({this.accountBloc, this.userRepository, this.context, this.isRegistration}) : super(LoginInitial()) {
|
||||
if (isRegistration) {
|
||||
ExerciseTreeApi().getExerciseTree();
|
||||
ExerciseTypeApi().getExerciseTypes();
|
||||
}
|
||||
}
|
||||
LoginBloc({this.accountBloc, this.userRepository, this.context, this.isRegistration}) : super(LoginInitial());
|
||||
|
||||
@override
|
||||
Stream<LoginState> mapEventToState(
|
||||
|
||||
@@ -43,11 +43,11 @@ class SettingsBloc extends Bloc<SettingsEvent, SettingsState> with Logging {
|
||||
_locale = AppLanguage().appLocal;
|
||||
yield SettingsReady(_locale);
|
||||
} else if (event is SettingsSetServer) {
|
||||
yield SettingsLoading();
|
||||
//yield SettingsLoading();
|
||||
final bool live = event.live;
|
||||
Cache().setServer(live);
|
||||
Track().track(TrackingEvent.settings_server, eventValue: live.toString());
|
||||
yield SettingsReady(_locale);
|
||||
//yield SettingsReady(_locale);
|
||||
} else if (event is SettingsSetHardware) {
|
||||
yield SettingsLoading();
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ part 'test_set_edit_state.dart';
|
||||
class TestSetEditBloc extends Bloc<TestSetEditEvent, TestSetEditState> {
|
||||
final String templateName;
|
||||
final String templateNameTranslation;
|
||||
String templateDescription;
|
||||
final WorkoutTreeRepository workoutTreeRepository;
|
||||
final MenuBloc menuBloc;
|
||||
final List<ExerciseType> _exerciseTypes = List();
|
||||
@@ -33,6 +34,7 @@ class TestSetEditBloc extends Bloc<TestSetEditEvent, TestSetEditState> {
|
||||
Cache().exercisePlanTemplates.forEach((element) {
|
||||
final ExercisePlanTemplate template = element as ExercisePlanTemplate;
|
||||
if (template.name == templateName) {
|
||||
templateDescription = template.descriptionTranslation;
|
||||
template.exerciseTypes.forEach((id) {
|
||||
final ExerciseType exerciseType = Cache().getExerciseTypeById(id);
|
||||
_exerciseTypes.add(exerciseType);
|
||||
@@ -77,7 +79,7 @@ class TestSetEditBloc extends Bloc<TestSetEditEvent, TestSetEditState> {
|
||||
yield TestSetEditLoading();
|
||||
ExercisePlan exercisePlan = ExercisePlan(templateNameTranslation, Cache().userLoggedIn.customerId);
|
||||
exercisePlan.private = true;
|
||||
exercisePlan.type = ExerciseAbility.mini_test_set.toString();
|
||||
exercisePlan.type = ExerciseAbility.mini_test_set.enumToString();
|
||||
exercisePlan.dateAdd = DateTime.now();
|
||||
ExercisePlan savedExercisePlan = await ExercisePlanApi().saveExercisePlan(exercisePlan);
|
||||
|
||||
|
||||
@@ -54,7 +54,6 @@ class TestSetExecuteBloc extends Bloc<TestSetExecuteEvent, TestSetExecuteState>
|
||||
element.exerciseType = exerciseType;
|
||||
}
|
||||
this.setPlanDetailState(element);
|
||||
print("exercises of ${element.exerciseTypeId}: ${element.exercises}");
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -88,6 +87,15 @@ class TestSetExecuteBloc extends Bloc<TestSetExecuteEvent, TestSetExecuteState>
|
||||
}
|
||||
await Cache().deleteActiveExercisePlan();
|
||||
}
|
||||
} else if (event is TestSetExecuteDeleteAllActive) {
|
||||
print("DeleteAll Test Set: ${exercisePlan.type}");
|
||||
if (exercisePlan != null) {
|
||||
exercisePlan = null;
|
||||
if (exercisePlanDetails != null) {
|
||||
exercisePlanDetails.removeRange(0, exercisePlanDetails.length - 1);
|
||||
}
|
||||
await Cache().deleteActiveExercisePlan();
|
||||
}
|
||||
} else if (event is TestSetExecuteExerciseFinished) {
|
||||
yield TestSetExecuteLoading();
|
||||
exercisePlanDetails.forEach((element) {
|
||||
@@ -120,11 +128,11 @@ class TestSetExecuteBloc extends Bloc<TestSetExecuteEvent, TestSetExecuteState>
|
||||
exercisePlan = ExercisePlan(Cache().userLoggedIn.name + " Custom Test", Cache().userLoggedIn.customerId);
|
||||
exercisePlan.private = true;
|
||||
exercisePlan.dateAdd = DateTime.now();
|
||||
exercisePlan.type = ExerciseAbility.paralell_test.enumToString();
|
||||
ExercisePlan savedExercisePlan = await ExercisePlanApi().saveExercisePlan(exercisePlan);
|
||||
exercisePlan = savedExercisePlan;
|
||||
exercisePlanDetails = List();
|
||||
}
|
||||
exercisePlan.type = ExerciseAbility.paralell_test.enumToString();
|
||||
|
||||
if (!this.existsInPlanDetails(event.exerciseTypeId)) {
|
||||
ExercisePlanDetail exercisePlanDetail = ExercisePlanDetail(event.exerciseTypeId);
|
||||
|
||||
@@ -52,3 +52,7 @@ class TestSetExecuteDeleteExercise extends TestSetExecuteEvent {
|
||||
class TestSetExecuteDeleteActive extends TestSetExecuteEvent {
|
||||
const TestSetExecuteDeleteActive();
|
||||
}
|
||||
|
||||
class TestSetExecuteDeleteAllActive extends TestSetExecuteEvent {
|
||||
const TestSetExecuteDeleteAllActive();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user