From 63f8b911e024be5c022c4c5b56e9518696dd2e9e Mon Sep 17 00:00:00 2001 From: Dat PHAM HOANG Date: Fri, 5 Apr 2024 21:18:28 +0700 Subject: [PATCH] Reload still keep composer open --- .../data/model/composer_cache.dart | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/lib/features/mailbox_dashboard/data/model/composer_cache.dart b/lib/features/mailbox_dashboard/data/model/composer_cache.dart index 5c5f29025..ed58d82c4 100644 --- a/lib/features/mailbox_dashboard/data/model/composer_cache.dart +++ b/lib/features/mailbox_dashboard/data/model/composer_cache.dart @@ -12,7 +12,7 @@ import 'package:model/extensions/media_type_nullable_extension.dart'; class ComposerCache with EquatableMixin { - final EmailId id; + final EmailId? id; final Map? mailboxIds; final String? subject; final Set? from; @@ -24,24 +24,23 @@ class ComposerCache with EquatableMixin { final Set? htmlBody; final Map? bodyValues; - ComposerCache( - this.id, - { - this.mailboxIds, - this.subject, - this.from, - this.to, - this.cc, - this.bcc, - this.replyTo, - this.textBody, - this.htmlBody, - this.bodyValues, - }); + ComposerCache({ + this.id, + this.mailboxIds, + this.subject, + this.from, + this.to, + this.cc, + this.bcc, + this.replyTo, + this.textBody, + this.htmlBody, + this.bodyValues, + }); factory ComposerCache.fromJson(Map json) { return ComposerCache( - EmailId(Id(json['id'])), + id: json['id'] != null ? EmailId(Id(json['id'])) : null, mailboxIds: (json['mailboxIds'] as Map?)?.map((key, value) => EmailMailboxIdsConverter().parseEntry(key, value)), subject: json['subject'] as String?, from: (json['from'] as List?)?.map((json) => EmailAddress.fromJson(json)).toSet(),