pushDialog<T> static method

Future<T?> pushDialog<T>(
  1. BuildContext context,
  2. Widget child, {
  3. bool barrierDismissible = true,
  4. Color? barrierColor = Colors.black54,
  5. String? barrierLabel,
  6. bool useSafeArea = true,
  7. bool useRootNavigator = true,
  8. RouteSettings? routeSettings,
})

Implementation

static Future<T?> pushDialog<T>(
  BuildContext context,
  Widget child, {
  bool barrierDismissible = true,
  Color? barrierColor = Colors.black54,
  String? barrierLabel,
  bool useSafeArea = true,
  bool useRootNavigator = true,
  RouteSettings? routeSettings,
}) {
  final WidgetWrapper? widgetWrapper = _getAppRouterDelegate(context).dialogWrapper;
  if (null != widgetWrapper) {
    child = widgetWrapper.call(child);
  }
  return _push<T>(
    context,
    child,
    block: (delegate, child) async {
      delegate.dialogState.onPushDialog(child);
      T? result = await showDialog<T>(
        context: context,
        builder: (context) => child,
        barrierDismissible: barrierDismissible,
        barrierColor: barrierColor,
        barrierLabel: barrierLabel,
        useSafeArea: useSafeArea,
        useRootNavigator: useRootNavigator,
        routeSettings: routeSettings,
      );
      result ??= _resultTemp[child];
      return result;
    },
  );
}