ScrollEndNotification class

A notification that a Scrollable widget has stopped scrolling.

This sample shows how you can trigger an auto-scroll, which aligns the last partially visible fixed-height list item, by listening for this notification with a NotificationListener. This sort of thing can also be done by listening to the ScrollController's ScrollPosition.isScrollingNotifier. An alternative example is provided with ScrollPosition.isScrollingNotifier.
link

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

This example auto-scrolls one special "aligned item" sliver to the top or bottom of the viewport, whenever it's partially visible (because it overlaps the top or bottom of the viewport). This example differs from the previous one in that the layout of an individual sliver is retrieved from its RenderSliver via a GlobalKey. The example does not rely on all of the list items having the same extent.
link

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

See also:

Inheritance

Constructors

ScrollEndNotification({required ScrollMetrics metrics, required BuildContext context, DragEndDetails? dragDetails})
Creates a notification that a Scrollable widget has stopped scrolling.

Properties

context BuildContext?
The build context of the widget that fired this notification.
finalinherited
depth int
The number of viewports that this notification has bubbled through.
no setterinherited
dragDetails DragEndDetails?
If the Scrollable stopped scrolling because of a drag, the details about that drag end.
final
hashCode int
The hash code for this object.
no setterinherited
metrics ScrollMetrics
A description of a Scrollable's contents, useful for modeling the state of its viewport.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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

Operators

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