showBottomSheet<T> function

PersistentBottomSheetController<T> showBottomSheet <T>({@required BuildContext context, @required WidgetBuilder builder })

Shows a persistent material design bottom sheet in the nearest Scaffold.

A persistent bottom sheet shows information that supplements the primary content of the app. A persistent bottom sheet remains visible even when the user interacts with other parts of the app. A Scaffold is required in the given context; its ScaffoldState.showBottomSheet method is used to actually show the bottom sheet.

A closely related widget is a modal bottom sheet, which is an alternative to a menu or a dialog and prevents the user from interacting with the rest of the app. Modal bottom sheets can be created and displayed with the showModalBottomSheet function.

Returns a controller that can be used to close and otherwise manipulate the bottom sheet.

To rebuild the bottom sheet (e.g. if it is stateful), call PersistentBottomSheetController.setState on the value returned from this method.

The context argument is used to look up the Scaffold for the bottom sheet. It is only used when the method is called. Its corresponding widget can be safely removed from the tree before the bottom sheet is closed.

See also:


PersistentBottomSheetController<T> showBottomSheet<T>({
  @required BuildContext context,
  @required WidgetBuilder builder,
}) {
  assert(context != null);
  assert(builder != null);
  return Scaffold.of(context).showBottomSheet<T>(builder);