show<T> static method
Future<T?>
show<T>({
- required BuildContext context,
- required List<
PlatformDialogAction< actions,T> > - String? title,
- String? message,
- Widget? content,
- bool barrierDismissible = true,
- Color? barrierColor = Colors.black54,
- String? barrierLabel,
- bool useSafeArea = true,
- RouteSettings? routeSettings,
- Offset? anchorPoint,
- dynamic onClose()?,
Displays a dialog.
When the dialog is popped, PlatformDialogAction.result is called and its return value becomes the result of the Future.
Implementation
static Future<T?> show<T>({
required BuildContext context,
required List<PlatformDialogAction<T>> actions,
String? title,
String? message,
Widget? content,
bool barrierDismissible = true,
Color? barrierColor = Colors.black54,
String? barrierLabel,
bool useSafeArea = true,
bool useRootNavigator = true,
RouteSettings? routeSettings,
Offset? anchorPoint,
Function()? onClose,
}) async {
assert(content != null || message != null);
return _queue.add<T?>(() {
if (context.owner == null) {
return null;
}
return showDialog<T>(
context: context,
builder: (context) => _PlatformAlertDialog<T>(
content: content ?? Text(message!),
actions: actions,
title: title,
),
barrierDismissible: barrierDismissible,
barrierColor: barrierColor,
barrierLabel: barrierLabel,
useSafeArea: useSafeArea,
useRootNavigator: useRootNavigator,
routeSettings: routeSettings,
anchorPoint: anchorPoint,
);
});
}