fix(mobile-app): refresh avatar on profile page after upload

Add _hasChanges flag to track changes and pass result when navigating back

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2025-12-07 23:32:42 -08:00
parent 0622dd14d9
commit dd26b9f48f
1 changed files with 5 additions and 1 deletions

View File

@ -43,6 +43,9 @@ class _EditProfilePageState extends ConsumerState<EditProfilePage> {
// //
bool _isUploadingAvatar = false; bool _isUploadingAvatar = false;
//
bool _hasChanges = false;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -76,7 +79,7 @@ class _EditProfilePageState extends ConsumerState<EditProfilePage> {
/// ///
void _goBack() { void _goBack() {
context.pop(); context.pop(_hasChanges);
} }
/// ///
@ -167,6 +170,7 @@ class _EditProfilePageState extends ConsumerState<EditProfilePage> {
_avatarUrl = newAvatarUrl; _avatarUrl = newAvatarUrl;
_selectedImageFile = null; // _selectedImageFile = null; //
_isUploadingAvatar = false; _isUploadingAvatar = false;
_hasChanges = true; //
}); });
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(