Sheet class

A material design bottom sheet.

There are two kinds of bottom sheets in material design:

  • Persistent. 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. Persistent bottom sheets can be created and displayed with the Sheet widget

  • Modal. A modal bottom sheet 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 SheetRoute route

The Sheet can be added inside a Stack above the content.

By default the bottom sheet inherits the values provided by the material theme and prioritize the ones passed in the constructor. Use Sheet.raw if you wish to remove the Material appearance and build your own

See also:

Inheritance

Constructors

Sheet({Key? key, required Widget child, SheetController? controller, SheetPhysics? physics, double? initialExtent, double? minExtent, double? maxExtent, double minInteractionExtent = 20.0, Color? backgroundColor, Clip? clipBehavior, ShapeBorder? shape, double? elevation, SheetFit fit = SheetFit.loose, bool resizable = false, EdgeInsets padding = EdgeInsets.zero, double? minResizableExtent})
Creates a material bottom sheet.
const
Sheet.raw({Key? key, required Widget child, SheetDecorationBuilder? decorationBuilder, SheetController? controller, SheetPhysics? physics, double? initialExtent, double? minExtent, double? maxExtent, double minInteractionExtent = 20.0, SheetFit fit = SheetFit.loose, bool resizable = false, EdgeInsets padding = EdgeInsets.zero, double? minResizableExtent})
Creates a bottom sheet with no default appearance.
const

Properties

backgroundColor Color?
The bottom sheet's background color.
final
child Widget
final
clipBehavior Clip?
The content will be clipped (or not) according to this option.
final
controller SheetController?
final
decorationBuilder SheetDecorationBuilder?
Wraps the child in a custom sheet decoration appearance If null, the sheet has material appareance
final
elevation double?
The z-coordinate at which to place this material relative to its parent.
final
fit SheetFit
How to size the child in the sheet.
final
hashCode int
The hash code for this object.
no setterinherited
initialExtent double?
The initial height to use when displaying the widget.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
maxExtent double?
The maximum height to use when displaying the widget.
final
minExtent double?
The minimum height to use when displaying the widget.
final
minInteractionExtent double
The height area of the minimum interaction zone to allow to drag up the sheet when it is closed
final
minResizableExtent double?
If resizable true, the minimum height that the sheet can be. The content of the sheet will be resized to fit the available visible space until this value, after that will be translated keeping this minimum height.
final
padding EdgeInsets
Empty space to surround the child.
final
physics SheetPhysics?
Determines the physics of a Sheet widget.
final
resizable bool
If true, the content of the sheet will be resized to fit the available visible space. If false, the content of the sheet will keep the same size and be translated vertically
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shape ShapeBorder?
The shape of the bottom sheet.
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
decorationBuild(BuildContext context, Widget child) Widget
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}) 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

of(BuildContext context) SheetState?
The state from the closest instance of this class that encloses the given context.