Redux (wip)
This commit is contained in:
parent
445c9c06cd
commit
866e776389
13 changed files with 150 additions and 7 deletions
27
lib/models/fireMapState.dart
Normal file
27
lib/models/fireMapState.dart
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import 'package:meta/meta.dart';
|
||||
|
||||
enum FireMapOperation { view, subscriptionConfirm, unsubscribe }
|
||||
|
||||
@immutable
|
||||
class FireMapState {
|
||||
final FireMapOperation currentOperation;
|
||||
|
||||
const FireMapState.initial(): this.currentOperation = FireMapOperation.view;
|
||||
|
||||
FireMapState({this.currentOperation: FireMapOperation.view});
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is FireMapState &&
|
||||
runtimeType == other.runtimeType &&
|
||||
currentOperation == other.currentOperation;
|
||||
|
||||
@override
|
||||
int get hashCode => currentOperation.hashCode;
|
||||
|
||||
FireMapState copyWith({FireMapOperation currentOperation}) {
|
||||
return new FireMapState(
|
||||
currentOperation: currentOperation ?? this.currentOperation);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue