Small fixes
This commit is contained in:
@@ -81,17 +81,17 @@ class _BaseEditTileBodyState<T> extends State<_BaseEditTileBody<T>> {
|
||||
return;
|
||||
}
|
||||
_stateNotifier.value = EditState.saving;
|
||||
final sms = ScaffoldMessenger.of(context);
|
||||
final scaffoldMessenger = ScaffoldMessenger.of(context);
|
||||
final locs = AppLocalizations.of(context)!;
|
||||
try {
|
||||
await widget.delegate.valueSetter(newValue);
|
||||
sms.showSnackBar(SnackBar(
|
||||
scaffoldMessenger.showSnackBar(SnackBar(
|
||||
content: Text(locs.settingsSuccessfullyUpdated),
|
||||
duration: const Duration(milliseconds: 1200),
|
||||
));
|
||||
} catch (e) {
|
||||
notifyUserOfErrorX(
|
||||
context: context,
|
||||
showErrorSnackBar(
|
||||
scaffoldMessenger: scaffoldMessenger,
|
||||
errorSituation: widget.delegate.errorSituation,
|
||||
appLocalizations: locs,
|
||||
exception: e,
|
||||
@@ -123,6 +123,7 @@ class _BaseEditTileBodyState<T> extends State<_BaseEditTileBody<T>> {
|
||||
);
|
||||
},
|
||||
);
|
||||
if (!mounted) return;
|
||||
if (result != null) await _performSave(result);
|
||||
}
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ class ImageTile extends AbstractSettingsTile {
|
||||
|
||||
Future<void> _pickImage(BuildContext context) async {
|
||||
final picker = ImagePicker();
|
||||
final scaffoldMessenger = ScaffoldMessenger.of(context);
|
||||
final locs = AppLocalizations.of(context)!;
|
||||
final picked = await picker.pickImage(
|
||||
source: ImageSource.gallery,
|
||||
@@ -55,8 +56,8 @@ class ImageTile extends AbstractSettingsTile {
|
||||
CachedNetworkImage.evictFromCache(imageUrl!);
|
||||
}
|
||||
} catch (e) {
|
||||
notifyUserOfErrorX(
|
||||
context: context,
|
||||
showErrorSnackBar(
|
||||
scaffoldMessenger: scaffoldMessenger,
|
||||
errorSituation: imageUpdateError ?? locs.settingsImageUpdateError,
|
||||
exception: e,
|
||||
appLocalizations: locs,
|
||||
|
||||
Reference in New Issue
Block a user