SheetScrollable class

A widget that transform to user drag.

SheetScrollable implements the interaction model for a draggable widget, including gesture recognition, but does not have an opinion about how the viewport, which actually displays the children, is constructed.

It's rare to construct a SheetScrollable directly. Instead, consider Sheet, which combine dragging, viewporting, and a layout model.

The static SheetScrollable.of and SheetScrollable.ensureVisible functions are often used to interact with the SheetScrollable widget inside a Sheet

Inheritance

Constructors

SheetScrollable({Key? key, AxisDirection axisDirection = AxisDirection.down, SheetController? controller, ScrollPhysics? physics, required ViewportBuilder viewportBuilder, bool excludeFromSemantics = false, int? semanticChildCount, DragStartBehavior dragStartBehavior = DragStartBehavior.start, String? restorationId, SheetBehavior? scrollBehavior, double? initialExtent, double minInteractionExtent = 0})
Creates a widget that scrolls.
const

Properties

axis Axis
The axis along which the scroll view scrolls.
no setter
axisDirection AxisDirection
The direction in which this widget scrolls.
final
controller SheetController?
An object that can be used to control the position to which this widget is scrolled.
final
dragStartBehavior DragStartBehavior
Determines the way that drag start behavior is handled.
final
excludeFromSemantics bool
Whether the scroll actions introduced by this SheetScrollable are exposed in the semantics tree.
final
hashCode int
The hash code for this object.
no setterinherited
initialExtent double?
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
minInteractionExtent double
final
physics ScrollPhysics?
How the widgets should respond to user input.
final
restorationId String?
Restoration ID to save and restore the scroll offset of the scrollable.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollBehavior SheetBehavior?
A ScrollBehavior that will be applied to this widget individually.
final
semanticChildCount int?
The number of children that will contribute semantic information.
final
viewportBuilder ViewportBuilder
Builds the viewport through which the scrollable content is displayed.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() SheetState
Creates the mutable state for this widget at a given location in the tree.
override
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.
override
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

ensureVisible(BuildContext context, {double alignment = 0.0, Duration duration = Duration.zero, Curve curve = Curves.ease, ScrollPositionAlignmentPolicy alignmentPolicy = ScrollPositionAlignmentPolicy.explicit}) Future<void>
Scrolls the scrollables that enclose the given context so as to make the given context visible.
of(BuildContext context) SheetState?
The state from the closest instance of this class that encloses the given context.