develop #1
|
@ -71,6 +71,7 @@ class ProfileController extends GetxController {
|
|||
birthDate.value = _userController.userData?.birthDate ?? "";
|
||||
phoneNumber.value = _userController.userData?.phone ?? "";
|
||||
joinDate.value = _userController.userData?.createdAt ?? "";
|
||||
|
||||
} catch (e, stackTrace) {
|
||||
logC.e("Failed to load user profile data: $e", stackTrace: stackTrace);
|
||||
}
|
||||
|
@ -112,8 +113,12 @@ class ProfileController extends GetxController {
|
|||
}
|
||||
}
|
||||
|
||||
void editProfile() {
|
||||
Get.toNamed(AppRoutes.updateProfilePage);
|
||||
void editProfile() async {
|
||||
final bool resultUpdate = await Get.toNamed(AppRoutes.updateProfilePage);
|
||||
|
||||
if (resultUpdate) {
|
||||
loadUserProfileData();
|
||||
}
|
||||
}
|
||||
|
||||
void changeLanguage(BuildContext context, String languageCode, String countryCode) async {
|
||||
|
|
|
@ -70,8 +70,6 @@ class UpdateProfileController extends GetxController {
|
|||
|
||||
Future<void> saveProfile() async {
|
||||
if (!await _connectionService.isHaveConnection()) {
|
||||
// Get.back();
|
||||
|
||||
ConnectionNotification.noInternedConnection();
|
||||
return;
|
||||
}
|
||||
|
@ -101,6 +99,7 @@ class UpdateProfileController extends GetxController {
|
|||
locale: userNew.locale,
|
||||
picUrl: userNew.picUrl,
|
||||
phone: userNew.phone,
|
||||
createdAt: userNew.createdAt,
|
||||
);
|
||||
|
||||
_userStorageService.saveUser(newUser);
|
||||
|
@ -113,7 +112,7 @@ class UpdateProfileController extends GetxController {
|
|||
}
|
||||
CustomFloatingLoading.hideLoading();
|
||||
|
||||
Get.back();
|
||||
Get.back(result: true);
|
||||
CustomNotification.success(title: "Success", message: "Profile updated successfully");
|
||||
} catch (e) {
|
||||
CustomNotification.success(title: "something wrong", message: "failed to update profile");
|
||||
|
|
Loading…
Reference in New Issue