WT1.1.8+3 custom plan and training plan fixes
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import 'dart:async';
|
||||
import 'package:aitrainer_app/model/cache.dart';
|
||||
import 'package:aitrainer_app/model/exercise_plan_detail.dart';
|
||||
import 'package:aitrainer_app/model/model_change.dart';
|
||||
import 'package:aitrainer_app/model/workout_menu_tree.dart';
|
||||
@@ -29,6 +30,7 @@ class ExercisePlanBloc extends Bloc<ExercisePlanEvent, ExercisePlanState> {
|
||||
menuTreeRepository.sortByMuscleType();
|
||||
|
||||
menuTreeRepository.sortedTree.forEach((key, value) {
|
||||
print("menutree $key");
|
||||
List<WorkoutMenuTree> listWorkoutTree = value;
|
||||
listWorkoutTree.forEach((workoutTree) {
|
||||
workoutTree.selected = false;
|
||||
@@ -48,9 +50,13 @@ class ExercisePlanBloc extends Bloc<ExercisePlanEvent, ExercisePlanState> {
|
||||
Stream<ExercisePlanState> mapEventToState(ExercisePlanEvent event) async* {
|
||||
try {
|
||||
if (event is ExercisePlanLoad) {
|
||||
if (Cache().userLoggedIn == null || Cache().userLoggedIn!.customerId == null) {
|
||||
throw Exception("Please log in");
|
||||
}
|
||||
yield ExercisePlanLoading();
|
||||
Track().track(TrackingEvent.my_custom_exercise_plan);
|
||||
customerId = Cache().userLoggedIn!.customerId!;
|
||||
await this.getData();
|
||||
Track().track(TrackingEvent.my_custom_exercise_plan);
|
||||
yield ExercisePlanReady();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user