TF-2035 Show calendar event banner in email view

(cherry picked from commit 130f575da86e23095d2b626ff8af133a7122ab2e)
This commit is contained in:
dab246
2023-07-24 19:40:09 +07:00
committed by Dat Vu
parent 41e0f841da
commit 588614f034
16 changed files with 570 additions and 22 deletions
@@ -1,8 +1,17 @@
import 'package:collection/collection.dart';
import 'package:jmap_dart_client/jmap/core/id.dart';
import 'package:model/email/attachment.dart';
import 'package:tmail_ui_user/features/email/domain/extensions/attachment_extension.dart';
import 'package:tmail_ui_user/features/offline_mode/model/attachment_hive_cache.dart';
extension ListAttachmentsExtension on List<Attachment> {
List<AttachmentHiveCache> toHiveCache() => map((attachment) => attachment.toHiveCache()).toList();
Set<Attachment> get calendarAttachments => where((attachment) => attachment.isCalendarEvent).toSet();
Set<Id> get calendarEventBlobIds => calendarAttachments
.map((attachment) => attachment.blobId)
.whereNotNull()
.toSet();
}