From 31dfec89eee8fe2d4995a5d52dccabef78c9a0a9 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Fri, 17 Apr 2020 12:00:42 +0200 Subject: [PATCH] Force refresh of current user account image when image settings panel is closed --- .../account_settings/account_image_settings.dart | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/ui/routes/account_settings/account_image_settings.dart b/lib/ui/routes/account_settings/account_image_settings.dart index f59a38d..ee03e02 100644 --- a/lib/ui/routes/account_settings/account_image_settings.dart +++ b/lib/ui/routes/account_settings/account_image_settings.dart @@ -1,7 +1,9 @@ +import 'package:comunic/helpers/database/users_database_helper.dart'; import 'package:comunic/helpers/settings_helper.dart'; import 'package:comunic/models/account_image_settings.dart'; import 'package:comunic/ui/widgets/async_screen_widget.dart'; import 'package:comunic/ui/widgets/network_image_widget.dart'; +import 'package:comunic/utils/account_utils.dart'; import 'package:comunic/utils/files_utils.dart'; import 'package:comunic/utils/intl_utils.dart'; import 'package:comunic/utils/ui_utils.dart'; @@ -37,6 +39,14 @@ class __AccountImageSettingsBodyState extends State<_AccountImageSettingsBody> { final _key = GlobalKey(); + @override + void dispose() { + // Remove current user information to force refresh of account image + UsersDatabaseHelper().delete(userID()); + + super.dispose(); + } + @override Widget build(BuildContext context) { return AsyncScreenWidget(