forked from eatvio/eatvio_app
refactor(all): refactor
This commit is contained in:
@@ -74,20 +74,16 @@ class MyProfileBloc extends Bloc<MyProfileEvent, MyProfileState> {
|
||||
waistCircumferenceController: TextEditingController(),
|
||||
hipCircumferenceController: TextEditingController(),
|
||||
weightController: TextEditingController(),
|
||||
chestCircumferenceFormController:
|
||||
currentState.chestCircumferenceFormController,
|
||||
waistCircumferenceFormController:
|
||||
currentState.waistCircumferenceFormController,
|
||||
hipCircumferenceFormController:
|
||||
currentState.hipCircumferenceFormController,
|
||||
chestCircumferenceFormController: currentState.chestCircumferenceFormController,
|
||||
waistCircumferenceFormController: currentState.waistCircumferenceFormController,
|
||||
hipCircumferenceFormController: currentState.hipCircumferenceFormController,
|
||||
firstNameFormController: currentState.firstNameFormController,
|
||||
lastNameFormController: currentState.lastNameFormController,
|
||||
countryFormController: currentState.countryFormController,
|
||||
cityFormController: currentState.cityFormController,
|
||||
heightFormController: currentState.heightFormController,
|
||||
upPressureFormController: currentState.upPressureFormController,
|
||||
downPressureFormController:
|
||||
currentState.downPressureFormController,
|
||||
downPressureFormController: currentState.downPressureFormController,
|
||||
allergiesFormController: currentState.allergiesFormController,
|
||||
pillsFormController: currentState.pillsFormController,
|
||||
favoriteFormController: currentState.favoriteFormController,
|
||||
@@ -181,8 +177,7 @@ class MyProfileBloc extends Bloc<MyProfileEvent, MyProfileState> {
|
||||
waistCircumferenceController: TextEditingController(),
|
||||
hipCircumferenceController: TextEditingController(),
|
||||
hypoFormController: data['userDetails']['has_hypo'].toString(),
|
||||
hyperFormController:
|
||||
data['userDetails']['has_hyper'].toString(),
|
||||
hyperFormController: data['userDetails']['has_hyper'].toString(),
|
||||
chestCircumferenceFormController: TextEditingController(
|
||||
text: data['userDetails']['chest_circumference']?.toString(),
|
||||
),
|
||||
@@ -201,12 +196,9 @@ class MyProfileBloc extends Bloc<MyProfileEvent, MyProfileState> {
|
||||
firstNameFormController: TextEditingController(
|
||||
text: data['userDetails']['first_name'],
|
||||
),
|
||||
lastNameFormController: TextEditingController(
|
||||
text: data['userDetails']['last_name']),
|
||||
countryFormController:
|
||||
TextEditingController(text: data['userDetails']['country']),
|
||||
cityFormController:
|
||||
TextEditingController(text: data['userDetails']['city']),
|
||||
lastNameFormController: TextEditingController(text: data['userDetails']['last_name']),
|
||||
countryFormController: TextEditingController(text: data['userDetails']['country']),
|
||||
cityFormController: TextEditingController(text: data['userDetails']['city']),
|
||||
heightFormController: TextEditingController(
|
||||
text: data['userDetails']['height']?.toString(),
|
||||
),
|
||||
@@ -234,8 +226,7 @@ class MyProfileBloc extends Bloc<MyProfileEvent, MyProfileState> {
|
||||
additionalFormController: TextEditingController(
|
||||
text: data['userDetails']['additional_info'],
|
||||
),
|
||||
dateFormController: TextEditingController(
|
||||
text: data['userDetails']['birthdate']),
|
||||
dateFormController: TextEditingController(text: data['userDetails']['birthdate']),
|
||||
selectedCity: data['userDetails']['city'],
|
||||
selectedCountry: data['userDetails']['country'],
|
||||
selectedActivity: determineActivityLevel(
|
||||
@@ -282,6 +273,7 @@ class MyProfileBloc extends Bloc<MyProfileEvent, MyProfileState> {
|
||||
var currentState = state as MyProfileLoadedState;
|
||||
|
||||
await uploadImageToServer(event.image.path, currentState.token);
|
||||
this.add(MyProfileInitialEvent());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user