WT1.1.0+3334 CustomerExerciseDevice fix, Badges fix
This commit is contained in:
@@ -30,6 +30,7 @@ class CustomerExerciseDeviceBloc extends Bloc<CustomerExerciseDeviceEvent, Custo
|
||||
} else if (event is CustomerExerciseDeviceAdd) {
|
||||
yield CustomerExerciseDeviceLoading();
|
||||
print("Add device " + event.device.exerciseDeviceId.toString());
|
||||
//await Future.delayed(const Duration(seconds: 2), () => "2");
|
||||
await repository.addDevice(event.device);
|
||||
Cache().initBadges();
|
||||
yield CustomerExerciseDeviceReady();
|
||||
|
||||
@@ -335,31 +335,34 @@ class ExerciseNewBloc extends Bloc<ExerciseNewEvent, ExerciseNewState> {
|
||||
if (this.bmi == 0) {
|
||||
getBMI();
|
||||
}
|
||||
//bmi = 15;
|
||||
final double distortionWidth = mediaWidth / baseWidth;
|
||||
final double distortionHeight = mediaHeight / baseHeight;
|
||||
print("W m " + mediaWidth.toString() + " b" + baseWidth.toString() + " d: " + distortionWidth.toString());
|
||||
print("H m " + mediaHeight.toString() + " b" + baseHeight.toString() + " d: " + distortionHeight.toString());
|
||||
this.bmiAngle = (bmi * 90 / 25) - 90;
|
||||
if (bmi < 18.5) {
|
||||
goalBMI = 19;
|
||||
this.bmiTop = 99;
|
||||
this.bmiLeft = 72;
|
||||
this.bmiTop = 99 * distortionHeight;
|
||||
this.bmiLeft = 77 * distortionWidth;
|
||||
bmiAngle = -62;
|
||||
} else if (bmi < 25 && 18.5 < bmi) {
|
||||
goalBMI = 27;
|
||||
this.bmiTop = 46;
|
||||
this.bmiLeft = 130;
|
||||
this.bmiTop = 48 * distortionHeight;
|
||||
this.bmiLeft = 130 * distortionWidth;
|
||||
bmiAngle = -23;
|
||||
} else if (bmi < 30 && 24.9 < bmi) {
|
||||
goalBMI = 24;
|
||||
this.bmiTop = 38.0;
|
||||
this.bmiLeft = 186.0;
|
||||
this.bmiTop = 40.0 * distortionHeight;
|
||||
this.bmiLeft = 184.0 * distortionWidth;
|
||||
bmiAngle = 7.2;
|
||||
} else if (bmi < 34.9 && 29.9 < bmi) {
|
||||
goalBMI = 29;
|
||||
bmiTop = 48;
|
||||
bmiLeft = 211;
|
||||
bmiTop = 48 * distortionHeight;
|
||||
bmiLeft = 211 * distortionWidth;
|
||||
} else if (bmi > 35) {
|
||||
goalBMI = 34;
|
||||
bmiTop = 94;
|
||||
bmiLeft = 260;
|
||||
bmiTop = 94 * distortionHeight;
|
||||
bmiLeft = 260 * distortionWidth;
|
||||
bmiAngle = 59;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user