pub struct ScrollMetricsNotification {
pub metrics: Rc<dyn ScrollMetrics>,
pub context: BuildContext,
/* private fields */
}Expand description
A notification that a scrollable widget’s ScrollMetrics have changed.
For example, when the content of a scrollable is altered, making it larger or smaller, this notification will be dispatched. Similarly, if the size of the window or parent changes, the scrollable can notify of these changes in dimensions.
The above behaviors usually do not trigger ScrollNotification events,
so this is useful for listening to ScrollMetrics changes that are not
caused by the user scrolling.
Fields§
§metrics: Rc<dyn ScrollMetrics>Description of a scrollable widget’s ScrollMetrics.
context: BuildContextThe build context of the widget that fired this notification.
This can be used to find the scrollable widget’s render objects to determine the size of the viewport, for instance.
Implementations§
Source§impl ScrollMetricsNotification
impl ScrollMetricsNotification
Sourcepub fn new(
metrics: Rc<dyn ScrollMetrics>,
context: BuildContext,
) -> ScrollMetricsNotification
pub fn new( metrics: Rc<dyn ScrollMetrics>, context: BuildContext, ) -> ScrollMetricsNotification
Creates a notification that the scrollable widget’s ScrollMetrics have
changed.
Sourcepub fn as_scroll_update(&self) -> ScrollUpdateNotification
pub fn as_scroll_update(&self) -> ScrollUpdateNotification
Convert this notification to a ScrollNotification.
This allows it to be used with crate::ScrollNotificationPredicates.
Trait Implementations§
Source§impl Debug for ScrollMetricsNotification
impl Debug for ScrollMetricsNotification
Source§impl Notification for ScrollMetricsNotification
impl Notification for ScrollMetricsNotification
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 ViewportNotificationMixin for ScrollMetricsNotification
impl ViewportNotificationMixin for ScrollMetricsNotification
Source§fn viewport_notification_data(&self) -> &ViewportNotificationData
fn viewport_notification_data(&self) -> &ViewportNotificationData
viewport_notification.