cake_wallet/lib/store/authentication_store.dart

33 lines
771 B
Dart
Raw Normal View History

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