confirm static method
Future<Object?>
confirm({
- required dynamic context,
- dynamic title,
- dynamic titleWidget,
- dynamic text,
- dynamic textWidget,
- dynamic cancelText,
- dynamic onValidate,
- dynamic onCancel,
Implementation
static Future<Object?> confirm(
{required context,
title,
titleWidget,
text,
textWidget,
cancelText,
onValidate,
onCancel}) {
assert(text != null || textWidget != null,
"You must specify either text or textWidget");
assert(onValidate != null, "You must specify an handler for onValidate");
return PopupHelper.showDialog(
context,
icon: Icons.contact_support,
Padding(
padding: const EdgeInsets.all(3.0),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
textWidget ??
Text(text, style: Theme.of(context).textTheme.bodySmall)
],
),
),
button1: okButton(
context: context,
onPress: () {
onValidate?.call();
}),
button2: cancelButton(
context: context,
onPress: () {
Navigator.of(context).pop();
onCancel?.call();
}),
title: title,
titleWidget: titleWidget,
);
}