showBottomSheet<T> static method
Future<T?>
showBottomSheet<T>({
- required BuildContext context,
- required Widget builder(),
- Color? backgroundColor,
- double? elevation,
- ShapeBorder? shape,
- Clip? clipBehavior,
- BoxConstraints? constraints,
- bool? enableDrag,
- bool isScrollControlled = false,
- bool isDismissible = true,
Show a Material bottom sheet
Implementation
static Future<T?> showBottomSheet<T>({
required BuildContext context,
required Widget Function(BuildContext) builder,
Color? backgroundColor,
double? elevation,
ShapeBorder? shape,
Clip? clipBehavior,
BoxConstraints? constraints,
bool? enableDrag,
bool isScrollControlled = false,
bool isDismissible = true,
bool? useRootNavigator,
}) async {
final blocker = _openOverlay();
try {
final result = await showModalBottomSheet<T>(
context: context,
builder: builder,
backgroundColor: backgroundColor,
elevation: elevation,
shape: shape,
clipBehavior: clipBehavior,
constraints: constraints,
enableDrag: enableDrag ?? true,
isScrollControlled: isScrollControlled,
isDismissible: isDismissible,
useRootNavigator: useRootNavigator ?? false,
);
return result;
} finally {
_closeOverlay(blocker);
}
}