mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-10-23 09:47:54 +00:00
profile page fix bugs
This commit is contained in:
@@ -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';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user