ScrollDirection enum
The direction of a scroll, relative to the positive scroll offset axis given by an AxisDirection and a GrowthDirection.
This is similar to GrowthDirection, but contrasts in that it has a third value, idle, for the case where no scroll is occurring.
This is used by RenderSliverFloatingPersistentHeader to only expand when the user is scrolling in the same direction as the detected scroll offset change.
To create a local project with this code sample, run:
flutter create --sample=rendering.ScrollDirection.1 mysample
See also:
- AxisDirection, which is a directional version of this enum (with values like left and right, rather than just horizontal).
- GrowthDirection, the direction in which slivers and their content are ordered, relative to the scroll offset axis as specified by AxisDirection.
- UserScrollNotification, which will notify listeners when the ScrollDirection changes.
Values
- idle → const ScrollDirection
-
No scrolling is underway.
- forward → const ScrollDirection
-
Scrolling is happening in the negative scroll offset direction.
For example, for the GrowthDirection.forward part of a vertical AxisDirection.down list, which is the default directional configuration of all scroll views, this means the content is going down, exposing earlier content as it approaches the zero position.
An anecdote for this most common case is 'forward is toward' the zero position.
- reverse → const ScrollDirection
-
Scrolling is happening in the positive scroll offset direction.
For example, for the GrowthDirection.forward part of a vertical AxisDirection.down list, which is the default directional configuration of all scroll views, this means the content is moving up, exposing lower content.
An anecdote for this most common case is reversing, or backing away, from the zero position.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- index → int
-
A numeric identifier for the enumerated value.
no setterinherited
- name → String
-
Available on Enum, provided by the EnumName extension
The name of the enum value.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
-
values
→ const List<
ScrollDirection> - A constant List of the values in this enum, in order of their declaration.