mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-08-25 20:19:39 +00:00
profile page
This commit is contained in:
@ -54,8 +54,7 @@ class ProfileBloc extends Bloc<ProfileEvent, ProfileState> {
|
||||
final lastName = nameParts.length > 1 ? nameParts[1] : '';
|
||||
var response = await ProfileApi.saveName(firstName: firstName, lastName: lastName);
|
||||
add(InitialProfileEvent());
|
||||
final homeCubit = event.context.read<HomeCubit>();
|
||||
await homeCubit.fetchUserInfo();
|
||||
await HomeCubit.getInstance().fetchUserInfo();
|
||||
Navigator.of(event.context).pop(true);
|
||||
CustomSnackBar.displaySnackBar('Save Successfully');
|
||||
emit(SaveState());
|
||||
@ -102,7 +101,6 @@ class ProfileBloc extends Bloc<ProfileEvent, ProfileState> {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Future selectTimeZone(SelectTimeZoneEvent event, Emitter<ProfileState> emit) async {
|
||||
try {
|
||||
emit(LoadingInitialState());
|
||||
@ -135,6 +133,7 @@ class ProfileBloc extends Bloc<ProfileEvent, ProfileState> {
|
||||
return region.name.toLowerCase().contains(query);
|
||||
}).toList() ?? [];
|
||||
regionList = filteredRegions;// Assume this fetches the regions
|
||||
|
||||
emit(RegionsLoadedState(regions: filteredRegions));
|
||||
}else{
|
||||
regionList = await ProfileApi.fetchRegion();
|
||||
@ -243,7 +242,7 @@ class ProfileBloc extends Bloc<ProfileEvent, ProfileState> {
|
||||
if (Platform.isAndroid ) {
|
||||
AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;
|
||||
PermissionStatus status = await Permission.photos.status;
|
||||
if(androidInfo.version.sdkInt<= 33){
|
||||
if(androidInfo.version.sdkInt<33){
|
||||
if (status.isDenied) {
|
||||
PermissionStatus status = await Permission.storage.request();
|
||||
if (status.isGranted) {
|
||||
|
Reference in New Issue
Block a user