TF-119 Filter messages with unread, attachments, starred

This commit is contained in:
dab246
2022-02-11 14:02:06 +07:00
committed by Dat H. Pham
parent c22bc94052
commit ca69bee4cd
22 changed files with 447 additions and 34 deletions
@@ -48,6 +48,7 @@ class EmailController extends BaseController {
final emailContents = <EmailContent>[].obs;
final attachments = <Attachment>[].obs;
EmailId? _currentEmailId;
List<Color>? _currentAvatarColor;
EmailController(
this._getEmailContentInteractor,
@@ -66,6 +67,7 @@ class EmailController extends BaseController {
mailboxDashBoardController.selectedEmail.listen((presentationEmail) {
if (_currentEmailId != presentationEmail?.id) {
_currentEmailId = presentationEmail?.id;
_currentAvatarColor = presentationEmail?.avatarColors;
_clearEmailContent();
final accountId = mailboxDashBoardController.accountId.value;
if (accountId != null && presentationEmail != null) {
@@ -151,7 +153,7 @@ class EmailController extends BaseController {
void _markAsEmailReadSuccess(Success success) {
if (success is MarkAsEmailReadSuccess) {
mailboxDashBoardController.setSelectedEmail(success.updatedEmail.toPresentationEmail(selectMode: SelectMode.ACTIVE));
mailboxDashBoardController.setSelectedEmail(success.updatedEmail.toPresentationEmail(selectMode: SelectMode.ACTIVE, avatarColors: _currentAvatarColor));
}
mailboxDashBoardController.dispatchState(Right(success));
@@ -83,10 +83,10 @@ class EmailView extends GetView {
width: double.infinity,
alignment: Alignment.center,
padding: EdgeInsets.only(
left: responsiveUtils.isMobile(context) ? 16 : 24,
right: responsiveUtils.isMobile(context) ? 16 : 24,
bottom: responsiveUtils.isMobile(context) ? 16 : 24,
top: responsiveUtils.isMobile(context) ? 10 : 16),
left: 16,
right: 16,
bottom: 16,
top: 16),
color: Colors.white,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
@@ -120,9 +120,9 @@ class EmailView extends GetView {
Widget _buildEmailMessage(BuildContext context) {
return Container(
padding: EdgeInsets.only(
bottom: responsiveUtils.isMobile(context) ? 16 : 24,
left: responsiveUtils.isMobile(context) ? 16 : 24,
right: responsiveUtils.isMobile(context) ? 16 : 24,
bottom: 16,
left: 16,
right: 16,
top: 10),
alignment: Alignment.center,
decoration: BoxDecoration(
@@ -42,7 +42,7 @@ class EmailContentItemBuilder {
padding: EdgeInsets.zero,
child: Text(
_emailContent.content,
style: TextStyle(fontSize: 14, color: AppColor.nameUserColor)));
style: TextStyle(fontSize: 14, color: AppColor.colorNameEmail)));
case EmailContentType.other:
return SizedBox.shrink();
}