TF-153 Combine moveToMailbox and moveToTrash to moveToMailbox using EmailActionType object

This commit is contained in:
dab246
2022-04-15 15:51:37 +07:00
committed by Dat H. Pham
parent 60aabfb6d1
commit 16c5aed64e
45 changed files with 268 additions and 722 deletions
+3 -3
View File
@@ -6,9 +6,9 @@ enum EmailActionType {
compose,
markAsRead,
markAsUnread,
markAsStar,
markAsUnStar,
move,
markAsStarred,
unMarkAsStarred,
moveToMailbox,
edit,
composeFromEmailAddress,
moveToTrash,
+4 -4
View File
@@ -17,11 +17,11 @@ extension FilterMessageOptionExtension on FilterMessageOption {
case FilterMessageOption.all:
return true;
case FilterMessageOption.unread:
return email.isUnReadEmail();
return !email.hasRead;
case FilterMessageOption.attachments:
return email.withAttachments;
case FilterMessageOption.starred:
return email.isFlaggedEmail();
return email.hasStarred;
}
}
@@ -30,11 +30,11 @@ extension FilterMessageOptionExtension on FilterMessageOption {
case FilterMessageOption.all:
return true;
case FilterMessageOption.unread:
return email.isUnReadEmail();
return !email.hasRead;
case FilterMessageOption.attachments:
return email.withAttachments;
case FilterMessageOption.starred:
return email.isFlaggedEmail();
return email.hasStarred;
}
}
}
-6
View File
@@ -1,6 +0,0 @@
enum MoveAction {
moveTo,
moveToTrash,
undo
}
+2 -4
View File
@@ -80,11 +80,9 @@ class PresentationEmail with EquatableMixin {
String getPartialContent() => preview ?? '';
bool isUnReadEmail() => !(keywords?.containsKey(KeyWordIdentifier.emailSeen) == true);
bool get hasRead => keywords?.containsKey(KeyWordIdentifier.emailSeen) == true;
bool isReadEmail() => keywords?.containsKey(KeyWordIdentifier.emailSeen) == true;
bool isFlaggedEmail() => keywords?.containsKey(KeyWordIdentifier.emailFlagged) == true;
bool get hasStarred => keywords?.containsKey(KeyWordIdentifier.emailFlagged) == true;
bool get withAttachments => hasAttachment == true;