showCancelOKAlert static method
Future
showCancelOKAlert(
{ - BuildContext? context,
- bool barrierDismissible = false,
- String? title,
- String? message,
- TextAlign? messageAlign,
- String? cancelTitle,
- dynamic cancelHandle()?,
- dynamic closeHandle()?,
- String? okTitle,
- required dynamic okHandle(),
})
Implementation
static Future showCancelOKAlert({
BuildContext? context,
bool barrierDismissible = false,
String? title,
String? message,
TextAlign? messageAlign,
String? cancelTitle,
Function()? cancelHandle,
Function()? closeHandle,
String? okTitle,
required Function() okHandle,
}) {
return showAlert(
context,
barrierDismissible: barrierDismissible,
alertViewBulider: (context) {
return CancelOKMessageAlertView(
title: title,
message: message,
messageAlign: messageAlign,
cancelTitle: cancelTitle ?? "取消",
cancelHandle: () {
Navigator.of(context).pop();
if (cancelHandle != null) {
cancelHandle();
}
},
okTitle: okTitle ?? "确定",
okHandle: () {
Navigator.of(context).pop();
okHandle();
},
closeHandle: () {
Navigator.of(context).pop();
if (closeHandle != null) {
closeHandle();
}
},
);
},
);
}