TF-123 Create objects for caching mailbox
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:model/model.dart';
|
||||
|
||||
part 'state_dao.g.dart';
|
||||
|
||||
@HiveType(typeId: CachingConstants.STATE_DAO_IDENTIFY)
|
||||
class StateDao extends HiveObject with EquatableMixin {
|
||||
|
||||
@HiveField(0)
|
||||
final StateType type;
|
||||
|
||||
@HiveField(1)
|
||||
final String state;
|
||||
|
||||
StateDao(this.type, this.state);
|
||||
|
||||
@override
|
||||
List<Object?> get props => [type, state];
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:model/model.dart';
|
||||
|
||||
part 'state_type.g.dart';
|
||||
|
||||
@HiveType(typeId: CachingConstants.STATE_TYPE_IDENTIFY)
|
||||
enum StateType {
|
||||
|
||||
@HiveField(0)
|
||||
mailbox
|
||||
}
|
||||
|
||||
extension StateTypeExtension on StateType {
|
||||
String get value {
|
||||
switch(this) {
|
||||
case StateType.mailbox:
|
||||
return 'mailbox';
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user