refactor(all): refactor

This commit is contained in:
alex
2024-07-09 17:50:32 +03:00
parent f79b9f03ae
commit e180ff16b6
37 changed files with 1706 additions and 1123 deletions

View File

@@ -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());
}
}