WT1.1.2e error fixes
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import 'package:aitrainer_app/bloc/account/account_bloc.dart';
|
||||
import 'package:aitrainer_app/model/cache.dart';
|
||||
import 'package:aitrainer_app/repository/exercise_repository.dart';
|
||||
import 'package:aitrainer_app/repository/user_repository.dart';
|
||||
import 'package:aitrainer_app/service/exercise_tree_service.dart';
|
||||
import 'package:aitrainer_app/service/exercisetype_service.dart';
|
||||
import 'package:aitrainer_app/util/common.dart';
|
||||
import 'package:flutter_form_bloc/flutter_form_bloc.dart';
|
||||
|
||||
@@ -50,6 +53,12 @@ class LoginFormBloc extends FormBloc<String, String> with Common {
|
||||
} else {
|
||||
// Emit either Loaded or Error
|
||||
await userRepository.getUser();
|
||||
await ExerciseTypeApi().getExerciseTypes();
|
||||
await ExerciseTreeApi().getExerciseTree();
|
||||
if ( Cache().userLoggedIn != null && Cache().userLoggedIn.customerId > 0) {
|
||||
ExerciseRepository exerciseRepository = ExerciseRepository();
|
||||
await exerciseRepository.getExercisesByCustomer(Cache().userLoggedIn.customerId);
|
||||
}
|
||||
emitSuccess(canSubmitAgain: false);
|
||||
accountBloc.add(AccountLogInFinished(customer: Cache().userLoggedIn));
|
||||
}
|
||||
|
||||
@@ -35,6 +35,10 @@ class MenuBloc extends Bloc<MenuEvent, MenuState> with Trans {
|
||||
|
||||
void setMenuInfo() {
|
||||
double percent = Cache().getPercentExercises();
|
||||
if ( percent == -1 ) {
|
||||
exerciseRepository.getBaseExerciseFinishedPercent();
|
||||
percent = Cache().getPercentExercises();
|
||||
}
|
||||
if ( context == null ) return;
|
||||
percent = percent * 100;
|
||||
print("Percent " + percent.toString());
|
||||
|
||||
Reference in New Issue
Block a user