show static method
Future<bool?>
show({
- required BuildContext context,
- String? title,
- required String message,
- IconData? icon,
- Color? iconColor,
- String? confirmText,
- String? cancelText,
- VoidCallback? onConfirm,
- VoidCallback? onCancel,
- Color? confirmButtonColor,
- Widget? contentWidget,
Show the confirmation dialog and return the result
Implementation
static Future<bool?> show({
required BuildContext context,
String? title,
required String message,
IconData? icon,
Color? iconColor,
String? confirmText,
String? cancelText,
VoidCallback? onConfirm,
VoidCallback? onCancel,
Color? confirmButtonColor,
Widget? contentWidget,
}) {
return showDialog<bool>(
context: context,
builder: (context) => TatweerConfirmationDialog(
title: title,
message: message,
icon: icon,
iconColor: iconColor,
confirmText: confirmText,
cancelText: cancelText,
onConfirm: () {
if (onConfirm != null) {
onConfirm();
} else {
Navigator.of(context).pop(true);
}
},
onCancel: () {
if (onCancel != null) {
onCancel();
} else {
Navigator.of(context).pop(false);
}
},
confirmButtonColor: confirmButtonColor,
contentWidget: contentWidget,
),
);
}