showCupertinoModalBottomSheet<T> static method
Future<T?>
showCupertinoModalBottomSheet<T>({
- required BuildContext context,
- double? closeProgressThreshold,
- required WidgetBuilder builder,
- Curve? animationCurve,
- Curve? previousRouteAnimationCurve,
- Color? backgroundColor,
- Color? barrierColor,
- bool expand = false,
- bool bounce = true,
- bool? isDismissible,
- bool enableDrag = true,
- Duration? duration,
- RouteSettings? settings,
- BoxShadow? shadow,
- 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;
}