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
@@ -151,11 +151,9 @@ class ForwardController extends BaseController {
void _handleDeleteRecipientSuccess(DeleteRecipientInForwardingSuccess success) {
if (currentOverlayContext != null && currentContext != null) {
_appToast.showToastWithIcon(
_appToast.showToastSuccessMessage(
currentOverlayContext!,
message: AppLocalizations.of(currentContext!).toastMessageDeleteRecipientSuccessfully,
icon: _imagePaths.icSelected,
);
AppLocalizations.of(currentContext!).toastMessageDeleteRecipientSuccessfully);
}
currentForward.value = success.forward;
@@ -255,11 +253,9 @@ class ForwardController extends BaseController {
void _handleAddRecipientsSuccess(AddRecipientsInForwardingSuccess success) {
if (currentOverlayContext != null && currentContext != null) {
_appToast.showToastWithIcon(
_appToast.showToastSuccessMessage(
currentOverlayContext!,
message: AppLocalizations.of(currentContext!).toastMessageAddRecipientsSuccessfully,
icon: _imagePaths.icSelected,
);
AppLocalizations.of(currentContext!).toastMessageAddRecipientsSuccessfully);
}
currentForward.value = success.forward;
@@ -283,13 +279,11 @@ class ForwardController extends BaseController {
void _handleEditLocalCopySuccess(EditLocalCopyInForwardingSuccess success) {
if (currentOverlayContext != null && currentContext != null) {
_appToast.showToastWithIcon(
_appToast.showToastSuccessMessage(
currentOverlayContext!,
message: success.forward.localCopy ?
AppLocalizations.of(currentContext!).toastMessageLocalCopyEnable :
AppLocalizations.of(currentContext!).toastMessageLocalCopyDisable,
icon: _imagePaths.icSelected,
);
success.forward.localCopy
? AppLocalizations.of(currentContext!).toastMessageLocalCopyEnable
: AppLocalizations.of(currentContext!).toastMessageLocalCopyDisable);
}
currentForward.value = success.forward;
@@ -133,19 +133,9 @@ class ForwardView extends GetWidget<ForwardController> with AppLoaderMixin {
controller.addRecipientAction(context, listRecipientsSelected);
},
onExceptionCallback: () {
_appToast.showBottomToast(
_appToast.showToastErrorMessage(
context,
AppLocalizations.of(context).incorrectEmailFormat,
leadingIcon: SvgPicture.asset(
_imagePaths.icNotConnection,
width: 24,
height: 24,
colorFilter: Colors.white.asFilter(),
fit: BoxFit.fill),
backgroundColor: AppColor.toastErrorBackgroundColor,
textColor: Colors.white,
textActionColor: Colors.white,
maxWidth: _responsiveUtils.getMaxWidthToast(context));
AppLocalizations.of(context).incorrectEmailFormat);
},
);
}