toBottomSheet<T> method
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
andbarrierColor
: 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,
);