TF-1594 Use only one class TmailToast to display the message.

(cherry picked from commit 379c34b32b2e5c4dad141e6a98bdb92597fa6908)
This commit is contained in:
dab246
2023-03-16 18:23:47 +07:00
committed by Dat Vu
parent fe05df3477
commit 4e17813e1a
34 changed files with 752 additions and 930 deletions
@@ -332,7 +332,7 @@ class SearchMailboxController extends BaseMailboxController with MailboxActionHa
void _moveMailboxSuccess(MoveMailboxSuccess success) {
if (success.moveAction == MoveAction.moving && currentOverlayContext != null && currentContext != null) {
_appToast.showBottomToast(
_appToast.showToastMessage(
currentOverlayContext!,
AppLocalizations.of(currentContext!).moved_to_mailbox(success.destinationMailboxName?.name ?? AppLocalizations.of(currentContext!).allMailboxes),
actionName: AppLocalizations.of(currentContext!).undo,
@@ -344,17 +344,11 @@ class SearchMailboxController extends BaseMailboxController with MailboxActionHa
parentId: success.destinationMailboxId)
);
},
leadingIcon: SvgPicture.asset(
imagePaths.icFolderMailbox,
width: 24,
height: 24,
colorFilter: Colors.white.asFilter(),
fit: BoxFit.fill),
leadingSVGIconColor: Colors.white,
leadingSVGIcon: imagePaths.icFolderMailbox,
backgroundColor: AppColor.toastSuccessBackgroundColor,
textColor: Colors.white,
textActionColor: Colors.white,
actionIcon: SvgPicture.asset(imagePaths.icUndo),
maxWidth: responsiveUtils.getMaxWidthToast(currentContext!)
actionIcon: SvgPicture.asset(imagePaths.icUndo)
);
}
@@ -396,11 +390,9 @@ class SearchMailboxController extends BaseMailboxController with MailboxActionHa
void _deleteMultipleMailboxSuccess(List<MailboxId> listMailboxIdDeleted, jmap.State? currentMailboxState) {
if (currentOverlayContext != null && currentContext != null) {
_appToast.showToastWithIcon(
_appToast.showToastSuccessMessage(
currentOverlayContext!,
message: AppLocalizations.of(currentContext!).delete_mailboxes_successfully,
icon: imagePaths.icSelected
);
AppLocalizations.of(currentContext!).delete_mailboxes_successfully);
}
if (listMailboxIdDeleted.contains(dashboardController.selectedMailbox.value?.id)) {
@@ -413,11 +405,9 @@ class SearchMailboxController extends BaseMailboxController with MailboxActionHa
void _deleteMailboxFailure(DeleteMultipleMailboxFailure failure) {
if (currentOverlayContext != null && currentContext != null) {
_appToast.showToastWithIcon(
_appToast.showToastErrorMessage(
currentOverlayContext!,
message: AppLocalizations.of(currentContext!).delete_mailboxes_failure,
icon: imagePaths.icDeleteToast
);
AppLocalizations.of(currentContext!).delete_mailboxes_failure);
}
}
@@ -503,7 +493,7 @@ class SearchMailboxController extends BaseMailboxController with MailboxActionHa
{List<MailboxId>? listDescendantMailboxIds}
) {
if (currentOverlayContext != null && currentContext != null) {
_appToast.showBottomToast(
_appToast.showToastMessage(
currentOverlayContext!,
subscribeAction.getToastMessageSuccess(currentContext!),
actionName: AppLocalizations.of(currentContext!).undo,
@@ -520,18 +510,11 @@ class SearchMailboxController extends BaseMailboxController with MailboxActionHa
);
}
},
leadingIcon: SvgPicture.asset(
imagePaths.icFolderMailbox,
width: 24,
height: 24,
colorFilter: Colors.white.asFilter(),
fit: BoxFit.fill
),
leadingSVGIconColor: Colors.white,
leadingSVGIcon: imagePaths.icFolderMailbox,
backgroundColor: AppColor.toastSuccessBackgroundColor,
textColor: Colors.white,
textActionColor: Colors.white,
actionIcon: SvgPicture.asset(imagePaths.icUndo),
maxWidth: responsiveUtils.getMaxWidthToast(currentContext!)
);
}
}