PageScrollDirection enum

Represents the direction of a scrolling action, such as navigating through paginated results, lists, or timeline-like structures.

This enum is commonly used in cursor-based pagination, UI navigation,
request traversal, and streaming APIs.

Directions

Usage Example

ScrollDirection direction = ScrollDirection.FORWARD;

// Reverse scrolling (FORWARD → BACKWARD)
direction = direction.reverse();

Behavior Notes

  • The enum is intentionally minimal and highly ergonomic for pagination use.
  • reverse always swaps to the opposite direction.
  • No-op states do not exist; both values always toggle deterministically.
Inheritance
Available extensions

Values

FORWARD → const PageScrollDirection

Scrolls forward, usually meaning:

  • toward next elements in a list
  • advancing a cursor or page
  • moving chronologically forward
BACKWARD → const PageScrollDirection

Scrolls backward, usually meaning:

  • toward previous elements
  • moving to an earlier cursor or page
  • navigating to older items

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
reverse() → PageScrollDirection
Returns the opposite scroll direction.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

values → const List<PageScrollDirection>
A constant List of the values in this enum, in order of their declaration.