Skip to main content

OnScrollEvent

Payload for flet.ScrollableControl.on_scroll handlers.

Inherits: Event

Properties

Properties

at_edgeproperty

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.

directionclass-attributeinstance-attribute

direction: Optional[ScrollDirection] = None

User scroll direction reported by Flutter.

Populated for flet.ScrollType.USER notifications.

event_typeinstance-attribute

event_type: ScrollType

Logical type of the scroll notification.

Determines which optional fields are populated:

extent_afterproperty

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_beforeproperty

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_totalproperty

extent_total: float

Total conceptual content extent available to the scrollable.

Equivalent to: max_scroll_extent - min_scroll_extent

max_scroll_extentinstance-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_extentinstance-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_rangeproperty

out_of_range: bool

Whether pixels is outside scroll extents.

Returns:

overscrollclass-attributeinstance-attribute

overscroll: Optional[float] = 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 flet.ScrollType.OVERSCROLL.

pixelsinstance-attribute

pixels: float

Current scroll offset in logical pixels.

scroll_deltaclass-attributeinstance-attribute

scroll_delta: Optional[float] = None

Delta in logical pixels since the previous update.

Populated for flet.ScrollType.UPDATE notifications.

velocityclass-attributeinstance-attribute

velocity: Optional[float] = None

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

Populated for flet.ScrollType.OVERSCROLL.

viewport_dimensioninstance-attribute

viewport_dimension: float

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