M3ESideSheet class
A Material 3 Expressive side sheet.
Shows secondary content anchored to the end edge of the window (the left
edge in right-to-left languages). The unnamed constructor is the modal
sheet; use M3ESideSheet.show to present it over a scrim, or
M3ESideSheetLayout to place a M3ESideSheet.standard sheet next to
the main content and switch to modal on compact windows.
The sheet reads as a dialog named by title. It has a close icon button by default, an optional back icon (onBack), a body that scrolls on its own, and optional bottom actions.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- M3ESideSheet
Constructors
-
M3ESideSheet({required String title, required Widget body, List<
Widget> actions = const <Widget>[], VoidCallback? onClose, bool showCloseButton = true, VoidCallback? onBack, bool? showDivider, bool showEdgeDivider = false, bool detached = false, M3ESideSheetEdge edge = M3ESideSheetEdge.end, double? width, bool scrollable = false, Widget? closeIcon, Widget? backIcon, M3ESideSheetTheme? theme, M3ESideSheetLabels labels = const M3ESideSheetLabels(), Key? key}) -
A modal side sheet surface. Placed directly, the close button pops
the current route unless
onCloseis set.const -
M3ESideSheet.standard({required String title, required Widget body, List<
Widget> actions = const <Widget>[], VoidCallback? onClose, bool showCloseButton = true, VoidCallback? onBack, bool? showDivider, bool showEdgeDivider = false, bool detached = false, M3ESideSheetEdge edge = M3ESideSheetEdge.end, double? width, bool scrollable = false, Widget? closeIcon, Widget? backIcon, M3ESideSheetTheme? theme, M3ESideSheetLabels labels = const M3ESideSheetLabels(), Key? key}) -
A standard side sheet that sits next to the main content.
const
Properties
-
actions
→ List<
Widget> -
Bottom action buttons, start-aligned, in focus order.
final
- backIcon → Widget?
-
Back glyph. Null uses
M3EIcons.arrow_back, mirrored in RTL.final - body → Widget
-
Sheet content. It fills the space between the header and actions.
final
- closeIcon → Widget?
-
Close glyph. Null uses
M3EIcons.close.final - detached → bool
-
Insets the sheet 16 from the window edges with every corner rounded.
final
- edge → M3ESideSheetEdge
-
Window edge the sheet is anchored to.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- labels → M3ESideSheetLabels
-
Accessibility strings.
final
- onBack → VoidCallback?
-
Shows a back icon button that calls this.
final
- onClose → VoidCallback?
-
Called when the close icon button is pressed.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollable → bool
-
Wraps body in a vertical scroll view. Leave false when body is
already a scrollable such as a
ListView.final - showCloseButton → bool
-
Whether to show the close icon button (recommended).
final
- showDivider → bool?
-
Divider above actions. Null shows it when there are actions.
final
- showEdgeDivider → bool
-
Vertical divider on the edge facing the main content.
final
- theme → M3ESideSheetTheme?
-
Per-sheet theme. Null uses
M3EThemeData.sideSheetTheme.final - title → String
-
Headline; also the dialog's accessible name.
final
- variant → M3ESideSheetVariant
-
Standard or modal.
final
- width → double?
-
Container width. Null uses the theme width (256); capped at 400.
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
-
show<
T> (BuildContext context, {required String title, required Widget body, List< Widget> actions = const <Widget>[], VoidCallback? onBack, bool showCloseButton = true, bool? showDivider, bool detached = false, M3ESideSheetEdge edge = M3ESideSheetEdge.end, double? width, bool scrollable = false, Widget? closeIcon, Widget? backIcon, bool isDismissible = true, Future<bool> onDismissRequest()?, M3ESideSheetController? controller, M3ESideSheetTheme? theme, M3ESideSheetLabels labels = const M3ESideSheetLabels(), }) → Future<T?> - Presents a modal side sheet and completes with the popped result.