show static method
Future<bool?>
show(
- BuildContext context, {
- required String title,
- String? message,
- String confirmLabel = 'Confirm',
- String cancelLabel = 'Cancel',
Show a confirmation dialog.
Returns true if the user confirmed, false (or null) if cancelled.
Implementation
static Future<bool?> show(
BuildContext context, {
required String title,
String? message,
String confirmLabel = 'Confirm',
String cancelLabel = 'Cancel',
}) {
return Navigator.of(context).showDialog<bool>(
builder: (ctx) => DialogConfirm(
title: title,
message: message,
confirmLabel: confirmLabel,
cancelLabel: cancelLabel,
onConfirm: () {
Navigator.of(ctx).pop(true);
return null;
},
onCancel: () {
Navigator.of(ctx).pop(false);
return null;
},
),
);
}