diff --git a/frontend/mobile-app/lib/features/profile/presentation/pages/edit_profile_page.dart b/frontend/mobile-app/lib/features/profile/presentation/pages/edit_profile_page.dart index 95e64d9b..5f16541d 100644 --- a/frontend/mobile-app/lib/features/profile/presentation/pages/edit_profile_page.dart +++ b/frontend/mobile-app/lib/features/profile/presentation/pages/edit_profile_page.dart @@ -43,6 +43,9 @@ class _EditProfilePageState extends ConsumerState { // 是否正在上传头像 bool _isUploadingAvatar = false; + // 是否有数据变更(用于返回时通知上一页刷新) + bool _hasChanges = false; + @override void initState() { super.initState(); @@ -76,7 +79,7 @@ class _EditProfilePageState extends ConsumerState { /// 返回上一页 void _goBack() { - context.pop(); + context.pop(_hasChanges); } /// 显示头像选择底部弹窗 @@ -167,6 +170,7 @@ class _EditProfilePageState extends ConsumerState { _avatarUrl = newAvatarUrl; _selectedImageFile = null; // 清除本地文件引用 _isUploadingAvatar = false; + _hasChanges = true; // 标记有变更 }); ScaffoldMessenger.of(context).showSnackBar(