show static method
Future<bool?>
show(
- BuildContext context, {
- String? title,
- required String message,
- String? confirmLabel,
- String? cancelLabel,
Show the dialog as a route and return the user's choice:
true: confirmedfalse: cancellednull: dismissed by tapping the barrier
Implementation
static Future<bool?> show(
BuildContext context, {
String? title,
required String message,
String? confirmLabel,
String? cancelLabel,
}) {
return Navigator.of(context).push<bool>(
PageRouteBuilder<bool>(
opaque: false,
barrierDismissible: true,
barrierColor: const Color(0x99000000),
pageBuilder: (BuildContext context, Animation<double> animation,
Animation<double> secondaryAnimation) {
return FadeTransition(
opacity: animation,
child: Center(
child: MiniDialog(
title: title,
message: message,
confirmLabel: confirmLabel,
cancelLabel: cancelLabel,
),
),
);
},
),
);
}