ScrollMetricsNotification class

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.

This sample shows how a ScrollMetricsNotification is dispatched when the windowSize is changed. Press the floating action button to increase the scrollable window's size.

To create a local project with this code sample, run:
flutter create --sample=widgets.ScrollMetricsNotification.1 mysample

Mixed in types


ScrollMetricsNotification({required ScrollMetrics metrics, required BuildContext context})
Creates a notification that the scrollable widget's ScrollMetrics have changed.


context BuildContext
The build context of the widget that fired this notification.
depth int
The number of viewports that this notification has bubbled through.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
metrics ScrollMetrics
Description of a scrollable widget's ScrollMetrics.
runtimeType Type
A representation of the runtime type of the object.
no setterinherited


asScrollUpdate() ScrollUpdateNotification
Convert this notification to a ScrollNotification.
debugFillDescription(List<String> description) → void
Add additional information to the given description for use by toString.
dispatch(BuildContext? target) → void
Start bubbling this notification at the given build context.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
toString() String
A string representation of this object.


operator ==(Object other) bool
The equality operator.