mirror of
https://github.com/wgh136/pixes.git
synced 2025-09-27 04:57:23 +00:00
improve login and logout
This commit is contained in:
@@ -63,13 +63,16 @@ class _Appdata {
|
||||
Future<void> readData() async {
|
||||
final file = File("${App.dataPath}/account.json");
|
||||
if (file.existsSync()) {
|
||||
account = Account.fromJson(jsonDecode(await file.readAsString()));
|
||||
var json = jsonDecode(await file.readAsString());
|
||||
if(json != null) {
|
||||
account = Account.fromJson(json);
|
||||
}
|
||||
}
|
||||
final settingsFile = File("${App.dataPath}/settings.json");
|
||||
if (settingsFile.existsSync()) {
|
||||
var json = jsonDecode(await settingsFile.readAsString());
|
||||
for (var key in json.keys) {
|
||||
if(json[key] != null) {
|
||||
if (json[key] != null) {
|
||||
settings[key] = json[key];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user