<fix>[profile]: Null check for city and countr selector

This commit is contained in:
2024-02-05 10:23:45 +03:00
parent dfb85216b4
commit 5352738906
2 changed files with 6 additions and 2 deletions

View File

@@ -87,6 +87,8 @@ class MyProfileBloc extends Bloc<MyProfileEvent, MyProfileState> {
dateFormController: currentState.dateFormController,
hypoFormController: currentState.hypoFormController,
hyperFormController: currentState.hyperFormController,
selectedCity: currentState.selectedCity,
selectedCountry: currentState.selectedCountry,
));
} else {
var plans = []
@@ -187,6 +189,8 @@ class MyProfileBloc extends Bloc<MyProfileEvent, MyProfileState> {
text: data['userDetails']['additional_info']),
dateFormController:
TextEditingController(text: data['userDetails']['birthdate']),
selectedCity: data['userDetails']['city'],
selectedCountry: data['userDetails']['country'],
));
}
} else {

View File

@@ -565,8 +565,8 @@ class _ExpandableListState extends State<ExpandableList> {
'favorite_foods': state?.favoriteFormController?.text,
'unfavorite_foods': state?.unfavoriteFormController?.text,
'additional_info': state?.additionalFormController?.text,
'country': state?.selectedCountry,
'city': state?.selectedCity,
'country': state?.selectedCountry ?? 'Россия',
'city': state?.selectedCity ?? 'Москва',
'has_hypo': state?.hypoFormController,
'has_hyper': state?.hyperFormController,
};