Added central user credentials management
This commit is contained in:
@ -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,
|
||||
}
|
Reference in New Issue
Block a user