1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-12-26 04:48:51 +00:00

Can update user name

This commit is contained in:
Pierre HUBERT 2020-04-27 13:34:25 +02:00
parent 2109c71dd6
commit 6ba89b6bd1

View File

@ -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<AsyncScreenWidgetState>();
@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,
),
];
}