fix: logout

This commit is contained in:
2025-05-13 12:05:52 +01:00
parent 1a912e88ce
commit f1e518a0d7

View File

@ -77,14 +77,17 @@ class LoginData extends ValueNotifier<LoginAccount?> {
LoginData() : super(null) {
super.addListener(() async {
final data = json.encode(LoginAccount.toJson(value));
await _storage.write(key: _storageKey, value: data);
if (value != null) {
final data = json.encode(LoginAccount.toJson(value));
await _storage.write(key: _storageKey, value: data);
} else {
await _storage.delete(key: _storageKey);
}
});
}
Future<void> logout() async {
void logout() {
super.value = null;
await _storage.delete(key: _storageKey);
}
Future<void> load() async {