toBottomSheet<T> method

Future<T?> toBottomSheet<T>(
  1. Widget bottomSheet, {
  2. bool isDismissible = true,
  3. bool enableDrag = true,
  4. bool isScrollControlled = false,
  5. Color? backgroundColor,
  6. double? elevation,
  7. ShapeBorder? shape,
  8. Clip? clipBehavior,
  9. Color? barrierColor,
  10. bool postponeToNextFrame = false,
})

Shows a modal material design bottom sheet that prevents the user from interacting with the rest of the app.

A closely related widget is the persistent bottom sheet, which allows the user to interact with the rest of the app. Persistent bottom sheets can be created and displayed with the NavigationBuilder.showBottomSheet or showBottomSheet Methods.

  • Required parameters:
  • bottomSheet: (positional parameter) Widget to display.
  • optional parameters:
  • isDismissible: whether the bottom sheet will be dismissed when user taps on the scrim. Default value is true.
  • enableDrag: whether the bottom sheet can be dragged up and down and dismissed by swiping downwards. Default value is true.
  • isScrollControlled: whether this is a route for a bottom sheet that will utilize DraggableScrollableSheet. If you wish to have a bottom sheet that has a scrollable child such as a ListView or a GridView and have the bottom sheet be draggable, you should set this parameter to true.Default value is false.
  • backgroundColor, elevation, shape, clipBehavior and barrierColor: used to customize the appearance and behavior of modal bottom sheets

Equivalent to: showModalBottomSheet.

Implementation

Future<T?> toBottomSheet<T>(
  Widget bottomSheet, {
  bool isDismissible = true,
  bool enableDrag = true,
  bool isScrollControlled = false,
  Color? backgroundColor,
  double? elevation,
  ShapeBorder? shape,
  Clip? clipBehavior,
  Color? barrierColor,
  bool postponeToNextFrame = false,
}) =>
    _navigationBuilder.toBottomSheet<T>(
      bottomSheet,
      isDismissible: isDismissible,
      enableDrag: enableDrag,
      isScrollControlled: isScrollControlled,
      backgroundColor: backgroundColor,
      elevation: elevation,
      shape: shape,
      clipBehavior: clipBehavior,
      barrierColor: barrierColor,
      postponeToNextFrame: postponeToNextFrame,
    );