Skip to content

OnScrollEvent

Inherits: Event['ScrollableControl']

Payload for ScrollableControl.on_scroll handlers.

Properties

Properties#

at_edge property #

at_edge: bool

Whether pixels is exactly at either scroll edge.

Returns:

  • bool

    True when pixels equals min_scroll_extent or max_scroll_extent; otherwise False.

direction class-attribute instance-attribute #

direction: ScrollDirection | None = None

User scroll direction reported by Flutter.

Populated for ScrollType.USER notifications.

event_type instance-attribute #

event_type: ScrollType

Logical type of the scroll notification.

Determines which optional fields are populated: - ScrollType.UPDATE: scroll_delta - ScrollType.USER: direction - ScrollType.OVERSCROLL: overscroll and velocity

extent_after property #

extent_after: float

Quantity of content conceptually "after" the viewport.

This corresponds to the content following the visible region in the current scroll direction.

extent_before property #

extent_before: float

Quantity of content conceptually "before" the viewport.

This corresponds to the content preceding the visible region in the current scroll direction.

extent_total property #

extent_total: float

Total conceptual content extent available to the scrollable.

Equivalent to: max_scroll_extent - min_scroll_extent + viewport_dimension.

max_scroll_extent instance-attribute #

max_scroll_extent: float

Maximum in-range value for pixels.

pixels may still be out_of_range during overscroll. For unbounded scrollables this value can be positive infinity.

min_scroll_extent instance-attribute #

min_scroll_extent: float

Minimum in-range value for pixels.

pixels may still be out_of_range during overscroll. For unbounded scrollables this value can be negative infinity.

out_of_range property #

out_of_range: bool

Whether pixels is outside scroll extents.

Returns:

overscroll class-attribute instance-attribute #

overscroll: float | None = None

Logical pixels that were prevented from being applied to pixels.

Negative values indicate overscroll on the start side; positive values indicate overscroll on the end side. Populated for ScrollType.OVERSCROLL.

pixels instance-attribute #

pixels: float

Current scroll offset in logical pixels.

scroll_delta class-attribute instance-attribute #

scroll_delta: float | None = None

Delta in logical pixels since the previous update.

Populated for ScrollType.UPDATE notifications.

velocity class-attribute instance-attribute #

velocity: float | None = None

Scroll velocity when overscroll occurred, in logical pixels per second.

Populated for ScrollType.OVERSCROLL.

viewport_dimension instance-attribute #

viewport_dimension: float

Visible viewport extent along the scroll axis, in logical pixels.