From 6ba89b6bd16130eb1960c8f9c1280e76c8a128e5 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Mon, 27 Apr 2020 13:34:25 +0200 Subject: [PATCH] Can update user name --- .../account_settings/general_account_settings.dart | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/ui/routes/account_settings/general_account_settings.dart b/lib/ui/routes/account_settings/general_account_settings.dart index d399e1c..313199b 100644 --- a/lib/ui/routes/account_settings/general_account_settings.dart +++ b/lib/ui/routes/account_settings/general_account_settings.dart @@ -1,3 +1,4 @@ +import 'package:comunic/helpers/database/users_database_helper.dart'; import 'package:comunic/helpers/settings_helper.dart'; import 'package:comunic/models/general_settings.dart'; import 'package:comunic/ui/widgets/async_screen_widget.dart'; @@ -36,6 +37,14 @@ class __GeneralAccountSettingsBodyState 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( @@ -76,6 +85,7 @@ class __GeneralAccountSettingsBodyState _settings.firstName = s; _updateSettings(); }, + checkInput: (s) => s.length >= 3, ), // Last name @@ -86,6 +96,7 @@ class __GeneralAccountSettingsBodyState _settings.lastName = s; _updateSettings(); }, + checkInput: (s) => s.length >= 3, ), ]; }