You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
601 B
24 lines
601 B
4 years ago
|
import 'package:mobx/mobx.dart';
|
||
|
|
||
|
part 'authentication_store.g.dart';
|
||
|
|
||
|
class AuthenticationStore = AuthenticationStoreBase with _$AuthenticationStore;
|
||
|
|
||
|
enum AuthenticationState { uninitialized, installed, allowed, denied }
|
||
|
|
||
|
abstract class AuthenticationStoreBase with Store {
|
||
|
AuthenticationStoreBase() : state = AuthenticationState.uninitialized;
|
||
|
|
||
|
@observable
|
||
|
AuthenticationState state;
|
||
|
|
||
|
@action
|
||
|
void installed() => state = AuthenticationState.installed;
|
||
|
|
||
|
@action
|
||
|
void allowed() => state = AuthenticationState.allowed;
|
||
|
|
||
|
@action
|
||
|
void denied() => state = AuthenticationState.denied;
|
||
|
}
|