From eb8bd19b476c925df0fd98e7d45cc04e42c9f695 Mon Sep 17 00:00:00 2001 From: maxxkim Date: Tue, 30 Jan 2024 14:26:37 +0300 Subject: [PATCH] Layout fixes --- .../bloc/my_profile_bloc.dart | 20 +++++++++---------- .../bloc/my_profile_state.dart | 2 ++ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/presentation/profile/my_profile_screen/bloc/my_profile_bloc.dart b/lib/presentation/profile/my_profile_screen/bloc/my_profile_bloc.dart index b8e7c983..88b64681 100644 --- a/lib/presentation/profile/my_profile_screen/bloc/my_profile_bloc.dart +++ b/lib/presentation/profile/my_profile_screen/bloc/my_profile_bloc.dart @@ -45,11 +45,7 @@ class MyProfileBloc extends Bloc { // Если текущее состояние уже загружено, обновляем его var currentState = state as MyProfileLoadedState; // Обновляем значения контроллеров только если они уже были созданы - if (currentState.firstNameFormController != null && - data['userDetails'] != null) { - currentState.firstNameFormController!.text = 'asdasdasd'; - // Повторите для других контроллеров и полей данных - } + emit((currentState).copyWith( chartPoints: data['chartPoints'], circumferences: data['circumferences'], @@ -97,6 +93,8 @@ class MyProfileBloc extends Bloc { text: data['userDetails']['hip_circumference']?.toString()), weightController: TextEditingController( text: data['userDetails']['weight']?.toString()), + weightFormController: TextEditingController( + text: data['userDetails']['weight']?.toString()), firstNameFormController: TextEditingController( text: data['userDetails']['first_name']), lastNameFormController: @@ -111,12 +109,12 @@ class MyProfileBloc extends Bloc { text: data['userDetails']['blood_pressure_up']?.toString()), downPressureFormController: TextEditingController( text: data['userDetails']['blood_pressure_down']?.toString()), - allergiesFormController: - TextEditingController(text: data['userDetails']['allergies']), - pillsFormController: - TextEditingController(text: data['userDetails']['pills']), - sportsFormController: - TextEditingController(text: data['userDetails']['sports']), + allergiesFormController: TextEditingController( + text: data['userDetails']['about_alergy']), + pillsFormController: TextEditingController( + text: data['userDetails']['about_taking_pils']), + sportsFormController: TextEditingController( + text: data['userDetails']['about_sport_hobbies']), )); } } else { diff --git a/lib/presentation/profile/my_profile_screen/bloc/my_profile_state.dart b/lib/presentation/profile/my_profile_screen/bloc/my_profile_state.dart index 55ed737e..32b5b349 100644 --- a/lib/presentation/profile/my_profile_screen/bloc/my_profile_state.dart +++ b/lib/presentation/profile/my_profile_screen/bloc/my_profile_state.dart @@ -123,6 +123,8 @@ class MyProfileLoadedState extends MyProfileState { TextEditingController? pillsFormController, TextEditingController? sportsFormController, String? token, + TextEditingController? downPressureFormController, + TextEditingController? upPressureFormController, }) { return MyProfileLoadedState( myProfileModelObj: myProfileModelObj ?? this.myProfileModelObj,