TF-1810 Add hive cache object for detailed email
(cherry picked from commit 0a8b2838205586c76e749d6b02496d22107726f4)
This commit is contained in:
@@ -14,6 +14,9 @@ class CachingConstants {
|
|||||||
static const int RECENT_LOGIN_URL_HIVE_CACHE_IDENTITY = 12;
|
static const int RECENT_LOGIN_URL_HIVE_CACHE_IDENTITY = 12;
|
||||||
static const int RECENT_LOGIN_USERNAME_HIVE_CACHE_IDENTITY = 13;
|
static const int RECENT_LOGIN_USERNAME_HIVE_CACHE_IDENTITY = 13;
|
||||||
static const int FCM_SUBSCRIPTION_HIVE_CACHE_IDENTITY = 14;
|
static const int FCM_SUBSCRIPTION_HIVE_CACHE_IDENTITY = 14;
|
||||||
|
static const int ATTACHMENT_HIVE_CACHE_ID = 15;
|
||||||
|
static const int EMAIL_HEADER_HIVE_CACHE_ID = 16;
|
||||||
|
static const int DETAILED_EMAIL_HIVE_CACHE_ID = 17;
|
||||||
|
|
||||||
static const String fcmCacheBoxName = 'fcm_cache_box';
|
static const String fcmCacheBoxName = 'fcm_cache_box';
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
|
||||||
|
import 'package:equatable/equatable.dart';
|
||||||
|
import 'package:hive/hive.dart';
|
||||||
|
import 'package:tmail_ui_user/features/caching/utils/caching_constants.dart';
|
||||||
|
|
||||||
|
part 'attachment_hive_cache.g.dart';
|
||||||
|
|
||||||
|
@HiveType(typeId: CachingConstants.ATTACHMENT_HIVE_CACHE_ID)
|
||||||
|
class AttachmentHiveCache extends HiveObject with EquatableMixin {
|
||||||
|
|
||||||
|
@HiveField(0)
|
||||||
|
final String? partId;
|
||||||
|
|
||||||
|
@HiveField(1)
|
||||||
|
final String? blobId;
|
||||||
|
|
||||||
|
@HiveField(2)
|
||||||
|
final int? size;
|
||||||
|
|
||||||
|
@HiveField(3)
|
||||||
|
final String? name;
|
||||||
|
|
||||||
|
@HiveField(4)
|
||||||
|
final String? type;
|
||||||
|
|
||||||
|
@HiveField(5)
|
||||||
|
final String? cid;
|
||||||
|
|
||||||
|
@HiveField(6)
|
||||||
|
final String? disposition;
|
||||||
|
|
||||||
|
AttachmentHiveCache({
|
||||||
|
this.partId,
|
||||||
|
this.blobId,
|
||||||
|
this.size,
|
||||||
|
this.name,
|
||||||
|
this.type,
|
||||||
|
this.cid,
|
||||||
|
this.disposition
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
List<Object?> get props => [
|
||||||
|
partId,
|
||||||
|
blobId,
|
||||||
|
size,
|
||||||
|
name,
|
||||||
|
type,
|
||||||
|
cid,
|
||||||
|
disposition
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
|
||||||
|
import 'package:equatable/equatable.dart';
|
||||||
|
import 'package:hive/hive.dart';
|
||||||
|
import 'package:tmail_ui_user/features/caching/utils/caching_constants.dart';
|
||||||
|
import 'package:tmail_ui_user/features/offline_mode/model/email_header_hive_cache.dart';
|
||||||
|
|
||||||
|
import 'attachment_hive_cache.dart';
|
||||||
|
|
||||||
|
part 'detailed_email_hive_cache.g.dart';
|
||||||
|
|
||||||
|
@HiveType(typeId: CachingConstants.DETAILED_EMAIL_HIVE_CACHE_ID)
|
||||||
|
class DetailedEmailHiveCache extends HiveObject with EquatableMixin {
|
||||||
|
|
||||||
|
@HiveField(0)
|
||||||
|
final String emailId;
|
||||||
|
|
||||||
|
@HiveField(1)
|
||||||
|
final DateTime timeSaved;
|
||||||
|
|
||||||
|
@HiveField(2)
|
||||||
|
final List<AttachmentHiveCache>? attachments;
|
||||||
|
|
||||||
|
@HiveField(3)
|
||||||
|
final String? emailContentPath;
|
||||||
|
|
||||||
|
@HiveField(4)
|
||||||
|
final List<EmailHeaderHiveCache>? headers;
|
||||||
|
|
||||||
|
DetailedEmailHiveCache({
|
||||||
|
required this.emailId,
|
||||||
|
required this.timeSaved,
|
||||||
|
this.attachments,
|
||||||
|
this.emailContentPath,
|
||||||
|
this.headers
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
List<Object?> get props => [
|
||||||
|
emailId,
|
||||||
|
timeSaved,
|
||||||
|
attachments,
|
||||||
|
emailContentPath,
|
||||||
|
headers
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
|
||||||
|
import 'package:equatable/equatable.dart';
|
||||||
|
import 'package:hive/hive.dart';
|
||||||
|
import 'package:tmail_ui_user/features/caching/utils/caching_constants.dart';
|
||||||
|
|
||||||
|
part 'email_header_hive_cache.g.dart';
|
||||||
|
|
||||||
|
@HiveType(typeId: CachingConstants.EMAIL_HEADER_HIVE_CACHE_ID)
|
||||||
|
class EmailHeaderHiveCache extends HiveObject with EquatableMixin {
|
||||||
|
|
||||||
|
@HiveField(0)
|
||||||
|
final String name;
|
||||||
|
|
||||||
|
@HiveField(1)
|
||||||
|
final String value;
|
||||||
|
|
||||||
|
EmailHeaderHiveCache({required this.name, required this.value});
|
||||||
|
|
||||||
|
@override
|
||||||
|
List<Object?> get props => [name, value];
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user