Added central user credentials management

This commit is contained in:
2023-06-11 18:18:37 +02:00
parent 04c244503e
commit 1521056217
22 changed files with 207 additions and 159 deletions

View File

@ -1,17 +1,17 @@
import 'package:flutter/cupertino.dart';
class AccountModel extends ChangeNotifier {
bool _isLoggedIn = false;
AccountModelState _accountState = AccountModelState.undefined;
AccountModelState get state => _accountState;
bool get isLoggedIn => _isLoggedIn;
void logout() {
_isLoggedIn = false;
void setState(AccountModelState state) {
_accountState = state;
notifyListeners();
}
}
void login() {
_isLoggedIn = true;
notifyListeners();
}
enum AccountModelState {
undefined,
loggedIn,
loggedOut,
}