OnScrollEvent
Inherits: Event['ScrollableControl']
Payload for ScrollableControl.on_scroll handlers.
Properties
-
at_edge(bool) –Whether
pixelsis exactly at either scroll edge. -
direction(ScrollDirection | None) –User scroll direction reported by Flutter.
-
event_type(ScrollType) –Logical type of the scroll notification.
-
extent_after(float) –Quantity of content conceptually "after" the viewport.
-
extent_before(float) –Quantity of content conceptually "before" the viewport.
-
extent_total(float) –Total conceptual content extent available to the scrollable.
-
max_scroll_extent(float) –Maximum in-range value for
pixels. -
min_scroll_extent(float) –Minimum in-range value for
pixels. -
out_of_range(bool) –Whether
pixelsis outside scroll extents. -
overscroll(float | None) –Logical pixels that were prevented from being applied to
pixels. -
pixels(float) –Current scroll offset in logical pixels.
-
scroll_delta(float | None) –Delta in logical pixels since the previous update.
-
velocity(float | None) –Scroll velocity when overscroll occurred, in logical pixels per second.
-
viewport_dimension(float) –Visible viewport extent along the scroll axis, in logical pixels.
Properties#
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:
-
bool–Trueifpixels<min_scroll_extentorpixels>max_scroll_extent; otherwiseFalse.
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.
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.