showPlatformDialog<T> function Null safety

Future<T?> showPlatformDialog<T>(
  1. {required BuildContext context,
  2. required WidgetBuilder builder,
  3. bool? barrierDismissible,
  4. RouteSettings? routeSettings,
  5. bool useRootNavigator = true,
  6. bool materialUseSafeArea = true,
  7. Color? materialBarrierColor,
  8. String? barrierLabel}
)

Implementation

Future<T?> showPlatformDialog<T>({
  required BuildContext context,
  required WidgetBuilder builder,
  bool? barrierDismissible,
  RouteSettings? routeSettings,
  bool useRootNavigator = true,
  bool materialUseSafeArea = true,
  Color? materialBarrierColor,
  String? barrierLabel,
}) {
  if (isMaterial(context)) {
    return showDialog<T>(
      context: context,
      builder: builder,
      barrierDismissible: barrierDismissible ?? true,
      routeSettings: routeSettings,
      useRootNavigator: useRootNavigator,
      useSafeArea: materialUseSafeArea,
      //child: , deprecated
      barrierColor: materialBarrierColor,
      barrierLabel: barrierLabel,
    );
  } else {
    return showCupertinoDialog<T>(
      context: context,
      builder: builder,
      routeSettings: routeSettings,
      useRootNavigator: useRootNavigator,
      barrierDismissible: barrierDismissible ?? false,
      barrierLabel: barrierLabel,
    );
  }
}