#156 opt.: show error of settings json

This commit is contained in:
lollipopkit
2023-09-07 16:41:38 +08:00
parent 459b647b68
commit 567f1442f5
7 changed files with 63 additions and 46 deletions

View File

@@ -370,6 +370,15 @@ class _HomePageState extends State<HomePage>
if (result == null) {
return;
}
_setting.box.putAll(json.decode(result) as Map<String, dynamic>);
try {
final newSettings = json.decode(result) as Map<String, dynamic>;
_setting.box.putAll(newSettings);
} catch (e) {
showRoundDialog(
context: context,
title: Text(_s.error),
child: Text('${_s.save}:\n$e'),
);
}
}
}