UserScrollNotification class
A notification that the user has changed the ScrollDirection in which they are scrolling, or have stopped scrolling.
For the direction that the ScrollView is oriented to, and the direction contents are being laid out in, see AxisDirection & GrowthDirection.
{@tool dartpad} This sample shows a CustomScrollView, with Radio buttons in the AppBar.bottom that change the AxisDirection to illustrate different configurations. With a NotificationListener to listen to UserScrollNotifications, which occur when the ScrollDirection changes or stops.
** See code in examples/api/lib/rendering/scroll_direction/scroll_direction.0.dart ** {@end-tool}
See also:
- ScrollNotification, which describes the notification lifecycle.
- Inheritance
-
- Object
- Notification
- LayoutChangedNotification
- ScrollNotification
- UserScrollNotification
Constructors
- UserScrollNotification.new({required ScrollMetrics metrics, required BuildContext context, required ScrollDirection direction})
- Creates a notification that the user has changed the direction in which they are 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
- direction → ScrollDirection
-
The direction in which the user is scrolling.
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