2020-06-20 07:10:00 +00:00
|
|
|
import 'package:mobx/mobx.dart';
|
|
|
|
|
|
|
|
part 'authentication_store.g.dart';
|
|
|
|
|
|
|
|
class AuthenticationStore = AuthenticationStoreBase with _$AuthenticationStore;
|
|
|
|
|
2023-03-06 16:42:15 +00:00
|
|
|
enum AuthenticationState { uninitialized, installed, allowed, _reset }
|
2020-06-20 07:10:00 +00:00
|
|
|
|
|
|
|
abstract class AuthenticationStoreBase with Store {
|
|
|
|
AuthenticationStoreBase() : state = AuthenticationState.uninitialized;
|
|
|
|
|
|
|
|
@observable
|
|
|
|
AuthenticationState state;
|
|
|
|
|
|
|
|
@action
|
2023-03-06 16:42:15 +00:00
|
|
|
void installed() {
|
|
|
|
state = AuthenticationState._reset;
|
|
|
|
state = AuthenticationState.installed;
|
|
|
|
}
|
2020-06-20 07:10:00 +00:00
|
|
|
|
|
|
|
@action
|
2023-03-06 16:42:15 +00:00
|
|
|
void allowed() {
|
|
|
|
state = AuthenticationState._reset;
|
|
|
|
state = AuthenticationState.allowed;
|
|
|
|
}
|
2020-06-20 07:10:00 +00:00
|
|
|
}
|