pub struct OverscrollNotification {
pub drag_details: Option<DragUpdateDetails>,
pub overscroll: f64,
pub velocity: f64,
/* private fields */
}Expand description
A notification that a Scrollable widget has not changed its scroll position
because the change would have caused its scroll position to go outside of
its scroll bounds.
See also:
ScrollUpdateNotification, which indicates that aScrollablewidget has changed its scroll position.ScrollNotification, which describes the notification lifecycle.
Fields§
§drag_details: Option<DragUpdateDetails>If the Scrollable overscrolled because of a drag, the details about that
drag update.
Otherwise, null.
overscroll: f64The number of logical pixels that the Scrollable avoided scrolling.
This will be negative for overscroll on the “start” side and positive for overscroll on the “end” side.
velocity: f64The velocity at which the ScrollPosition was changing when this
overscroll happened.
This will typically be 0.0 for touch-driven overscrolls, and positive
for overscrolls that happened from a BallisticScrollActivity or
DrivenScrollActivity.
Implementations§
Source§impl OverscrollNotification
impl OverscrollNotification
Sourcepub fn new(
metrics: Rc<dyn ScrollMetrics>,
context: BuildContext,
overscroll: f64,
) -> OverscrollNotification
pub fn new( metrics: Rc<dyn ScrollMetrics>, context: BuildContext, overscroll: f64, ) -> OverscrollNotification
Creates a notification that a Scrollable widget has changed its scroll
position outside of its scroll bounds.
Sourcepub fn drag_details(
self,
drag_details: DragUpdateDetails,
) -> OverscrollNotification
pub fn drag_details( self, drag_details: DragUpdateDetails, ) -> OverscrollNotification
Dart OverscrollNotification(dragDetails:).
Sourcepub fn velocity(self, velocity: f64) -> OverscrollNotification
pub fn velocity(self, velocity: f64) -> OverscrollNotification
Dart OverscrollNotification(velocity:).
Trait Implementations§
Source§impl Debug for OverscrollNotification
impl Debug for OverscrollNotification
impl LayoutChangedNotification for OverscrollNotification
Source§impl Notification for OverscrollNotification
impl Notification for OverscrollNotification
Source§fn viewport_depth(&self) -> Option<&Cell<u32>>
fn viewport_depth(&self) -> Option<&Cell<u32>>
ViewportNotificationMixin
(widgets/scroll_notification.rs), for the viewport elements that increment it as
the notification bubbles past them; None — the default — for every other
notification. Read moreSource§fn as_scroll_notification(&self) -> Option<&dyn ScrollNotification>
fn as_scroll_notification(&self) -> Option<&dyn ScrollNotification>
ScrollNotification (widgets/scroll_notification.rs), for a
NotificationListener<dyn ScrollNotification>; None — the default — for every
other notification. Read moreSource§fn as_layout_changed_notification(
&self,
) -> Option<&dyn LayoutChangedNotification>
fn as_layout_changed_notification( &self, ) -> Option<&dyn LayoutChangedNotification>
LayoutChangedNotification
(widgets/notification_listener.rs), for a
NotificationListener<dyn LayoutChangedNotification>; None — the default — for every
other notification. Read moreSource§impl ScrollNotification for OverscrollNotification
impl ScrollNotification for OverscrollNotification
Source§fn scroll_notification_data(&self) -> &ScrollNotificationData
fn scroll_notification_data(&self) -> &ScrollNotificationData
scroll_notification.Source§fn metrics(&self) -> &Rc<dyn ScrollMetrics>
fn metrics(&self) -> &Rc<dyn ScrollMetrics>
Scrollable’s contents, useful for modeling the state
of its viewport.Source§fn context(&self) -> Option<BuildContext>
fn context(&self) -> Option<BuildContext>
Source§impl ViewportNotificationMixin for OverscrollNotification
impl ViewportNotificationMixin for OverscrollNotification
Source§fn viewport_notification_data(&self) -> &ViewportNotificationData
fn viewport_notification_data(&self) -> &ViewportNotificationData
viewport_notification.