TF-80 Undo when move email to mailbox success from email detailed view
This commit is contained in:
@@ -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
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user