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:
@ -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!"));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user