WT1.1.2 build 32 login error messages fixes

This commit is contained in:
bossanyit
2020-11-20 15:32:06 +01:00
parent 3ce32434bf
commit ed8760f8e8
13 changed files with 90 additions and 97 deletions
@@ -16,6 +16,9 @@ class CustomerChangeBloc extends Bloc<CustomerChangeEvent, CustomerChangeState>
double height = 170;
CustomerChangeBloc({this.customerRepository}) : super(CustomerChangeInitial()) {
year = this.customerRepository.customer.birthYear;
if (year == 0) {
year = 1990;
}
weight = this.customerRepository.getWeight();
height = this.customerRepository.getHeight();
}
@@ -288,6 +288,10 @@ class ExerciseNewBloc extends Bloc<ExerciseNewEvent, ExerciseNewState> {
}
double getBMI() {
if (height == 0) {
this.bmi = 0;
return 0;
}
this.bmi = weight / (height * height / 10000);
this.getGoalBMI();
return this.bmi;
+3
View File
@@ -47,8 +47,11 @@ class LoginFormBloc extends FormBloc<String, String> with Common {
} else {
// Emit either Loaded or Error
await PropertyApi().getProperties();
print("properties OK");
await userRepository.getUser();
print("get User OK");
await ExerciseTypeApi().getExerciseTypes();
print("exerciesTypes OK");
await ExerciseTreeApi().getExerciseTree();
if (Cache().userLoggedIn != null && Cache().userLoggedIn.customerId > 0) {
ExerciseRepository exerciseRepository = ExerciseRepository();