OnScrollEvent
Payload for flet.ScrollableControl.on_scroll handlers.
Inherits: Event
Properties
at_edge- Whether pixels is exactly at either scroll edge.direction- User scroll direction reported by Flutter.event_type- Logical type of the scroll notification.extent_after- Quantity of content conceptually "after" the viewport.extent_before- Quantity of content conceptually "before" the viewport.extent_total- Total conceptual content extent available to the scrollable.max_scroll_extent- Maximum in-range value for pixels.min_scroll_extent- Minimum in-range value for pixels.out_of_range- Whether pixels is outside scroll extents.overscroll- Logical pixels that were prevented from being applied topixels.pixels- Current scroll offset in logical pixels.scroll_delta- Delta in logical pixels since the previous update.velocity- Scroll velocity when overscroll occurred, in logical pixels per second.viewport_dimension- Visible viewport extent along the scroll axis, in logical pixels.
Properties
at_edgeproperty
at_edge: boolWhether pixels is exactly at either scroll edge.
Returns:
- bool -
Truewhenpixelsequalsmin_scroll_extentormax_scroll_extent; otherwiseFalse.
directionclass-attributeinstance-attribute
direction: Optional[ScrollDirection] = NoneUser scroll direction reported by Flutter.
Populated for flet.ScrollType.USER notifications.
event_typeinstance-attribute
event_type: ScrollTypeLogical type of the scroll notification.
Determines which optional fields are populated:
extent_afterproperty
extent_after: floatQuantity of content conceptually "after" the viewport.
This corresponds to the content following the visible region in the current scroll direction.
extent_beforeproperty
extent_before: floatQuantity of content conceptually "before" the viewport.
This corresponds to the content preceding the visible region in the current scroll direction.
extent_totalproperty
extent_total: floatTotal conceptual content extent available to the scrollable.
Equivalent to: max_scroll_extent - min_scroll_extent
max_scroll_extentinstance-attribute
max_scroll_extent: floatMaximum 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: floatMinimum 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: boolWhether pixels is outside scroll extents.
Returns:
- bool -
Trueif pixels < min_scroll_extent or pixels > max_scroll_extent; otherwiseFalse.
overscrollclass-attributeinstance-attribute
overscroll: Optional[float] = NoneLogical 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.
scroll_deltaclass-attributeinstance-attribute
scroll_delta: Optional[float] = NoneDelta in logical pixels since the previous update.
Populated for flet.ScrollType.UPDATE notifications.
velocityclass-attributeinstance-attribute
velocity: Optional[float] = NoneScroll velocity when overscroll occurred, in logical pixels per second.
Populated for flet.ScrollType.OVERSCROLL.
viewport_dimensioninstance-attribute
viewport_dimension: floatVisible viewport extent along the scroll axis, in logical pixels.