M3EBottomSheet class
A Material 3 Expressive bottom sheet.
Shows secondary content anchored to the bottom of the screen, up to 640dp wide with 28dp top corners. Use M3EBottomSheet.show for a modal sheet over a scrim and M3EBottomSheet.standard for a sheet that sits next to the main UI. The optional drag handle resizes the sheet by drag, tap, Space or Enter.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- M3EBottomSheet
Constructors
-
M3EBottomSheet({required Widget child, bool showDragHandle = true, bool enableDrag = true, M3EBottomSheetValue initialValue = M3EBottomSheetValue.collapsed, bool expandToFullScreen = false, String? fullScreenTitle, M3EBottomSheetController? controller, ValueChanged<
M3EBottomSheetValue> ? onValueChanged, M3EBottomSheetTheme? theme, M3EBottomSheetLabels labels = const M3EBottomSheetLabels(), Key? key}) -
A modal sheet surface. M3EBottomSheet.show presents it in a route;
placed directly, dragging it away pops the current route.
const
-
M3EBottomSheet.standard({required Widget child, bool showDragHandle = true, bool enableDrag = true, bool isDismissible = false, M3EBottomSheetValue initialValue = M3EBottomSheetValue.collapsed, double? previewHeight, bool expandToFullScreen = false, String? fullScreenTitle, M3EBottomSheetController? controller, ValueChanged<
M3EBottomSheetValue> ? onValueChanged, M3EBottomSheetTheme? theme, M3EBottomSheetLabels labels = const M3EBottomSheetLabels(), Key? key}) -
A standard sheet that co-exists with the main UI (no scrim).
const
Properties
- child → Widget
-
Sheet content. Vertical lists that use the primary scroll controller
resize the sheet before they scroll.
final
- controller → M3EBottomSheetController?
-
Drives the sheet without dragging.
final
- enableDrag → bool
-
Whether dragging resizes the sheet.
final
- expandToFullScreen → bool
-
Adds a full-screen height with a collapse (standard) or close (modal)
header. The sheet then spans the full view width.
final
- fullScreenTitle → String?
-
Title in the full-screen header.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialValue → M3EBottomSheetValue
-
Height to rest at first. Collapsed is capped at half the screen.
final
- isDismissible → bool
-
Standard: whether dragging down (or the handle cycle) may hide it.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- labels → M3EBottomSheetLabels
-
Accessibility strings.
final
-
onValueChanged
→ ValueChanged<
M3EBottomSheetValue> ? -
Called when the sheet rests at a new height.
final
- previewHeight → double?
-
Standard: optional peek height below the collapsed height.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showDragHandle → bool
-
Whether to show the drag handle.
final
- theme → M3EBottomSheetTheme?
-
Per-sheet theme. Null uses
M3EThemeData.bottomSheetTheme.final - variant → M3EBottomSheetVariant
-
Standard or modal.
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
scrollControllerOf(
BuildContext context) → M3EBottomSheetScrollController? - The scroll controller of the enclosing sheet, if any.
-
show<
T> (BuildContext context, {required WidgetBuilder builder, bool showDragHandle = true, bool isDismissible = true, bool enableDrag = true, M3EBottomSheetValue initialValue = M3EBottomSheetValue.collapsed, bool expandToFullScreen = false, String? fullScreenTitle, M3EBottomSheetController? controller, ValueChanged< M3EBottomSheetValue> ? onValueChanged, Future<bool> onDismissRequest()?, M3EBottomSheetTheme? theme, M3EBottomSheetLabels labels = const M3EBottomSheetLabels(), }) → Future<T?> - Presents a modal bottom sheet and completes with the popped result.
-
showAdaptive<
T> (BuildContext context, {required String title, required WidgetBuilder builder, List< Widget> sideSheetActions = const <Widget>[], bool showDragHandle = true, bool isDismissible = true, bool enableDrag = true, M3EBottomSheetValue initialValue = M3EBottomSheetValue.collapsed, bool expandToFullScreen = false, M3EBottomSheetController? controller, ValueChanged<M3EBottomSheetValue> ? onValueChanged, Future<bool> onDismissRequest()?, M3EBottomSheetTheme? theme, M3EBottomSheetLabels labels = const M3EBottomSheetLabels()}) → Future<T?> -
Shows a modal bottom sheet on compact and medium windows, and an
M3ESideSheetwithtitleandsideSheetActionson expanded ones.