TF-80 Undo when move email to mailbox success from email detailed view

This commit is contained in:
dab246
2021-09-21 10:07:16 +07:00
committed by Dat H. Pham
parent afc8c0fe77
commit 24e52dc6a4
4 changed files with 56 additions and 0 deletions
@@ -1,6 +1,8 @@
import 'package:core/presentation/extensions/color_extension.dart';
import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:getwidget/components/toast/gf_toast.dart';
import 'package:getwidget/getwidget.dart';
class AppToast {
void showToast(String message) {
@@ -32,4 +34,25 @@ class AppToast {
toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.BOTTOM);
}
void showToastWithAction(BuildContext context, String message, String actionName, Function onActionClick) {
GFToast.showToast(
message,
context,
toastPosition: GFToastPosition.BOTTOM,
textStyle: TextStyle(fontSize: 16, color: Colors.white),
backgroundColor: AppColor.toastWithActionBackgroundColor,
trailing: GFButton(
onPressed: () {
ToastView.dismiss();
onActionClick();
},
text: actionName,
type: GFButtonType.transparent,
color: AppColor.buttonActionToastWithActionColor,
),
toastBorderRadius: 5.0,
toastDuration: 3
);
}
}