1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2025-06-20 00:35:17 +00:00

Can change account image from tour

This commit is contained in:
2021-04-17 18:33:08 +02:00
parent 7c8a82566f
commit 899270961a
2 changed files with 62 additions and 22 deletions

View File

@ -160,17 +160,7 @@ class _AccountImageSettingsScreenState
/// Upload a new account image
void _uploadAccountImage() async {
try {
final image = await pickImage(context,
aspectRatio: CropAspectRatio(ratioX: 5, ratioY: 5));
if (image == null) return;
await SettingsHelper.uploadAccountImage(image);
} catch (e, s) {
logError(e, s);
snack(context, tr("Failed to upload new account image!"));
}
await uploadNewAccountImage(context);
_key.currentState.refresh();
}
@ -203,3 +193,17 @@ class _AccountImageSettingsScreenState
_key.currentState.refresh();
}
}
Future<void> uploadNewAccountImage(BuildContext context) async {
try {
final image = await pickImage(context,
aspectRatio: CropAspectRatio(ratioX: 5, ratioY: 5));
if (image == null) return;
await SettingsHelper.uploadAccountImage(image);
} catch (e, s) {
logError(e, s);
snack(context, tr("Failed to upload new account image!"));
}
}