show static method
void
show(})
Show a confirmation dialog via DialogStack.
Pushes a DialogConfirm onto the nearest DialogStack and waits for the user's response.
Implementation
static void show(
BuildContext context, {
required String title,
String? message,
String confirmLabel = 'Confirm',
String cancelLabel = 'Cancel',
void Function(bool confirmed)? onResult,
}) {
final stack = DialogStack.of(context);
stack.push(
DialogConfirm(
title: title,
message: message,
confirmLabel: confirmLabel,
cancelLabel: cancelLabel,
onConfirm: () {
stack.pop();
onResult?.call(true);
return null;
},
onCancel: () {
stack.pop();
onResult?.call(false);
return null;
},
),
);
}