showFlexibleBottomSheet<T> function Null safety

Future<T?> showFlexibleBottomSheet<T>(
  1. {required BuildContext context,
  2. required FlexibleDraggableScrollableWidgetBuilder builder,
  3. double? minHeight,
  4. double? initHeight,
  5. double? maxHeight,
  6. bool isCollapsible = true,
  7. bool isDismissible = true,
  8. bool isExpand = true,
  9. bool useRootNavigator = false,
  10. bool isModal = true,
  11. List<double>? anchors}
)

Shows a flexible bottom sheet.

builder - content's builder. minHeight - min height in fractional value for bottom sheet. e.g. 0.1. initHeight - init height in fractional value for bottom sheet. e.g. 0.5. maxHeight - init height in fractional value for bottom sheet. e.g. 0.5. isModal - if true, overlay background with dark color. anchors - list of sizes in fractional value that the bottom sheet can accept.

Implementation

Future<T?> showFlexibleBottomSheet<T>({
  required BuildContext context,
  required FlexibleDraggableScrollableWidgetBuilder builder,
  double? minHeight,
  double? initHeight,
  double? maxHeight,
  bool isCollapsible = true,
  bool isDismissible = true,
  bool isExpand = true,
  bool useRootNavigator = false,
  bool isModal = true,
  List<double>? anchors,
}) {
  assert(debugCheckHasMediaQuery(context));
  assert(debugCheckHasMaterialLocalizations(context));

  return Navigator.of(context, rootNavigator: useRootNavigator).push(
    _FlexibleBottomSheetRoute<T>(
      theme: Theme.of(context),
      barrierLabel: MaterialLocalizations.of(context).modalBarrierDismissLabel,
      minHeight: minHeight ?? 0,
      initHeight: initHeight ?? 0.5,
      maxHeight: maxHeight ?? 1,
      isCollapsible: isCollapsible,
      isDismissible: isDismissible,
      isExpand: isExpand,
      builder: builder,
      isModal: isModal,
      anchors: anchors,
    ),
  );
}