showCupertinoModalBottomSheet<T> static method

Future<T?> showCupertinoModalBottomSheet<T>({
  1. required BuildContext context,
  2. double? closeProgressThreshold,
  3. required WidgetBuilder builder,
  4. Curve? animationCurve,
  5. Curve? previousRouteAnimationCurve,
  6. Color? backgroundColor,
  7. Color? barrierColor,
  8. bool expand = false,
  9. bool useRootNavigator = false,
  10. bool bounce = true,
  11. bool? isDismissible,
  12. bool enableDrag = true,
  13. Duration? duration,
  14. RouteSettings? settings,
  15. BoxShadow? shadow,
  16. SystemUiOverlayStyle? overlayStyle,
})

Implementation

static Future<T?> showCupertinoModalBottomSheet<T>({
  required BuildContext context,
  double? closeProgressThreshold,
  required WidgetBuilder builder,
  Curve? animationCurve,
  Curve? previousRouteAnimationCurve,
  Color? backgroundColor,
  Color? barrierColor,
  bool expand = false,
  bool useRootNavigator = false,
  bool bounce = true,
  bool? isDismissible,
  bool enableDrag = true,
  Duration? duration,
  RouteSettings? settings,
  BoxShadow? shadow,
  SystemUiOverlayStyle? overlayStyle,
}) async {
  assert(debugCheckHasMediaQuery(context));
  final isCupertinoApp =
      context.findAncestorWidgetOfExactType<CupertinoApp>() != null;
  var barrierLabel = '';
  if (!isCupertinoApp) {
    assert(debugCheckHasMaterialLocalizations(context));
    barrierLabel = MaterialLocalizations.of(context).modalBarrierDismissLabel;
  }
  final topRadius = CupertinoScaffold.of(context)!.topRadius;
  final result = await Navigator.of(context, rootNavigator: useRootNavigator)
      .push(CupertinoModalBottomSheetRoute<T>(
    closeProgressThreshold: closeProgressThreshold,
    builder: builder,
    secondAnimationController: CupertinoScaffold.of(context)!.animation,
    containerBuilder: (context, _, child) => _CupertinoBottomSheetContainer(
      child: child,
      backgroundColor: backgroundColor,
      topRadius: topRadius ?? _kDefaultTopRadius,
      shadow: shadow,
    ),
    expanded: expand,
    barrierLabel: barrierLabel,
    bounce: bounce,
    isDismissible: isDismissible ?? expand == false ? true : false,
    modalBarrierColor: barrierColor ?? Colors.black12,
    enableDrag: enableDrag,
    topRadius: topRadius ?? _kDefaultTopRadius,
    animationCurve: animationCurve,
    previousRouteAnimationCurve: previousRouteAnimationCurve,
    duration: duration,
    settings: settings,
    overlayStyle: overlayStyle,
  ));
  return result;
}