WT1.1.2 build 32 login error messages fixes
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user