bottomSheet<T> method
Future<T?>
bottomSheet<T>(
- Widget bottomSheet, {
- Color? backgroundColor,
- double? elevation,
- bool persistent = true,
- ShapeBorder? shape,
- Clip? clipBehavior,
- Color? barrierColor,
- bool? ignoreSafeArea,
- bool? safeAreaBottom,
- bool isDismissible = true,
- bool enableDrag = true,
- RouteSettings? settings,
- Duration? enterBottomSheetDuration,
- Duration? exitBottomSheetDuration,
- bool keyboardSafe = true,
Implementation
Future<T?> bottomSheet<T>(
Widget bottomSheet, {
Color? backgroundColor,
double? elevation,
bool persistent = true,
ShapeBorder? shape,
Clip? clipBehavior,
Color? barrierColor,
bool? ignoreSafeArea,
bool? safeAreaBottom,
bool useRootNavigator = false,
bool isDismissible = true,
bool enableDrag = true,
RouteSettings? settings,
Duration? enterBottomSheetDuration,
Duration? exitBottomSheetDuration,
bool keyboardSafe = true,
}) {
if (settings?.arguments != null) {
routing.args = settings!.arguments;
}
return Navigator.of(overlayContext!, rootNavigator: useRootNavigator)
.push(GetModalBottomSheetRoute<T>(
builder: (_) => bottomSheet,
isPersistent: persistent,
// theme: Theme.of(key.currentContext, shadowThemeOnly: true),
theme: Theme.of(key.currentContext!),
barrierLabel: MaterialLocalizations.of(key.currentContext!)
.modalBarrierDismissLabel,
backgroundColor: backgroundColor ?? Colors.transparent,
elevation: elevation,
shape: shape,
removeTop: ignoreSafeArea ?? true,
safeAreaBottom: safeAreaBottom ?? true,
clipBehavior: clipBehavior,
isDismissible: isDismissible,
modalBarrierColor: barrierColor,
settings: settings,
enableDrag: enableDrag,
enterBottomSheetDuration:
enterBottomSheetDuration ?? const Duration(milliseconds: 250),
exitBottomSheetDuration:
exitBottomSheetDuration ?? const Duration(milliseconds: 200),
keyboardSafe: keyboardSafe,
));
}