showDialog<B> method

Future<B?> showDialog<B>({
  1. required Widget builder(
    1. BuildContext context
    ),
  2. bool barrierDismissible = true,
  3. Color? barrierColor,
  4. String? barrierLabel,
  5. bool useSafeArea = true,
  6. bool useRootNavigator = true,
  7. RouteSettings? routeSettings,
  8. Offset? anchorPoint,
  9. TraversalEdgeBehavior? traversalEdgeBehavior,
})

Implementation

Future<B?> showDialog<B>({
  required Widget Function(BuildContext context) builder,
  bool barrierDismissible = true,
  Color? barrierColor,
  String? barrierLabel,
  bool useSafeArea = true,
  bool useRootNavigator = true,
  RouteSettings? routeSettings,
  Offset? anchorPoint,
  TraversalEdgeBehavior? traversalEdgeBehavior,
}) async {
  return await material.showDialog<B>(
    context: this,
    barrierDismissible: barrierDismissible,
    barrierColor: barrierColor,
    barrierLabel: barrierLabel,
    useSafeArea: useSafeArea,
    useRootNavigator: useRootNavigator,
    routeSettings: routeSettings,
    anchorPoint: anchorPoint,
    traversalEdgeBehavior: traversalEdgeBehavior,
    builder: (context) {
      return ScaffoldMessenger(
        child: Builder(
          builder: builder,
        ),
      );
    },
  );
}