showDialog<T> static method
Future<T?>
showDialog<T>(
- BuildContext context, {
- required Widget body,
- bool barrierDismissible = true,
- Color? barrierColor,
- String? barrierLabel,
- RouteSettings? routeSettings,
- List<
Widget> ? actions, - DialogThemeData? theme,
- Widget? title,
- bool allowScroll = true,
Implementation
static Future<T?> showDialog<T>(
BuildContext context, {
required Widget body,
bool barrierDismissible = true,
Color? barrierColor,
String? barrierLabel,
bool useRootNavigator = true,
RouteSettings? routeSettings,
List<Widget>? actions,
DialogThemeData? theme,
Widget? title,
bool allowScroll = true,
}) {
final Color barrierColor = DialogTheme.of(context).barrierColor!;
final CapturedThemes themes = InheritedTheme.capture(
from: context,
to: Navigator.of(
context,
rootNavigator: useRootNavigator,
).context,
);
return Navigator.of(context, rootNavigator: useRootNavigator).push<T>(
DialogRoute<T>(
context: context,
pageBuilder: (context, animation, secondaryAnimation) => Dialog(
body: body,
actions: actions,
theme: theme,
title: title,
allowScroll: allowScroll,
),
barrierColor: barrierColor,
barrierDismissible: barrierDismissible,
barrierLabel: barrierLabel,
settings: routeSettings,
themes: themes,
),
);
}