Made google-play login working again, and fixed numerous bugs
All checks were successful
update version / increment-build-number (push) Successful in 9s
All checks were successful
update version / increment-build-number (push) Successful in 9s
This commit is contained in:
@ -35,7 +35,7 @@ class AccountData {
|
||||
return _password!;
|
||||
}
|
||||
|
||||
Future<void> setData(BuildContext context, String username, String password) async {
|
||||
Future<void> setData(String username, String password) async {
|
||||
SharedPreferences storage = await _storage;
|
||||
|
||||
storage.setString(_usernameField, username);
|
||||
@ -43,9 +43,10 @@ class AccountData {
|
||||
await _updateFromStorage();
|
||||
}
|
||||
|
||||
Future<void> removeData(BuildContext context) async {
|
||||
Future<void> removeData({BuildContext? context}) async {
|
||||
_populated = Completer();
|
||||
Provider.of<AccountModel>(context, listen: false).setState(AccountModelState.loggedOut);
|
||||
|
||||
if(context != null) Provider.of<AccountModel>(context, listen: false).setState(AccountModelState.loggedOut);
|
||||
|
||||
SharedPreferences storage = await _storage;
|
||||
await storage.remove(_usernameField);
|
||||
@ -54,12 +55,12 @@ class AccountData {
|
||||
|
||||
Future<void> _updateFromStorage() async {
|
||||
SharedPreferences storage = await _storage;
|
||||
await storage.reload();
|
||||
//await storage.reload(); // This line was the cause of the first rejected google play upload :(
|
||||
if(storage.containsKey(_usernameField) && storage.containsKey(_passwordField)) {
|
||||
_username = storage.getString(_usernameField);
|
||||
_password = storage.getString(_passwordField);
|
||||
}
|
||||
_populated.complete();
|
||||
if(!_populated.isCompleted) _populated.complete();
|
||||
}
|
||||
|
||||
Future<bool> waitForPopulation() async {
|
||||
|
Reference in New Issue
Block a user