profile page fix bugs

This commit is contained in:
mohammad
2024-07-29 12:28:12 +03:00
parent eebd0faf1e
commit cd8cdf0853
@@ -157,6 +157,7 @@ class ProfileBloc extends Bloc<ProfileEvent, ProfileState> {
void _fetchRegion(RegionInitialEvent event, Emitter<ProfileState> emit) async { void _fetchRegion(RegionInitialEvent event, Emitter<ProfileState> emit) async {
try { try {
emit(LoadingInitialState()); emit(LoadingInitialState());
regionList = await ProfileApi.fetchRegion(); regionList = await ProfileApi.fetchRegion();
emit(RegionsLoadedState(regions: regionList!)); emit(RegionsLoadedState(regions: regionList!));
} catch (e) { } catch (e) {
@@ -249,7 +250,7 @@ class ProfileBloc extends Bloc<ProfileEvent, ProfileState> {
} }
final parts = withoutExtraSpaces.split(' '); final parts = withoutExtraSpaces.split(' ');
if (parts.length < 2) return 'Full name must contain first and last names'; if (parts.length < 2) return 'Full name must contain first and last names';
if (parts.length > 2) return 'Full name can at most contain 3 parts'; if (parts.length > 2) return 'Full name can at most contain 2 parts';
if (parts.any((part) => part.length < 2 || part.length > 30)) { if (parts.any((part) => part.length < 2 || part.length > 30)) {
return 'Full name parts must be between 2 and 30 characters long'; return 'Full name parts must be between 2 and 30 characters long';
} }