showBottomSheet<T> static method

Future<T?> showBottomSheet<T>({
  1. required BuildContext context,
  2. required Widget builder(
    1. BuildContext
    ),
  3. Color? backgroundColor,
  4. double? elevation,
  5. ShapeBorder? shape,
  6. Clip? clipBehavior,
  7. BoxConstraints? constraints,
  8. bool? enableDrag,
  9. bool isScrollControlled = false,
  10. bool isDismissible = true,
  11. bool? useRootNavigator,
})

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);
  }
}