DraggableScrollableNotification class Null safety
A Notification related to the extent, which is the size, and scroll offset, which is the position of the child list, of the DraggableScrollableSheet.
DraggableScrollableSheet widgets notify their ancestors when the size of the sheet changes. When the extent of the sheet changes via a drag, this notification bubbles up through the tree, which means a given NotificationListener will receive notifications for all descendant DraggableScrollableSheet widgets. To focus on notifications from the nearest DraggableScrollableSheet descendant, check that the depth property of the notification is zero.
When an extent notification is received by a NotificationListener, the listener will already have completed build and layout, and it is therefore too late for that widget to call State.setState. Any attempt to adjust the build or layout based on an extent notification would result in a layout that lagged one frame behind, which is a poor user experience. Extent notifications are used primarily to drive animations. The Scaffold widget listens for extent notifications and responds by driving animations for the FloatingActionButton as the bottom sheet scrolls up.
- Inheritance
-
- Object
- Notification
- DraggableScrollableNotification
- Mixed in types
Constructors
- DraggableScrollableNotification({required double extent, required double minExtent, required double maxExtent, required double initialExtent, required BuildContext context})
- Creates a notification that the extent of a DraggableScrollableSheet has changed.
Properties
- context → BuildContext
-
The build context of the widget that fired this notification.
final
- depth → int
-
The number of viewports that this notification has bubbled through.
read-onlyinherited
- extent → double
-
The current value of the extent, between minExtent and maxExtent.
final
- hashCode → int
-
The hash code for this object.
read-onlyinherited
- initialExtent → double
-
The initially requested value for extent.
final
- maxExtent → double
-
The maximum value of extent.
final
- minExtent → double
-
The minimum value of extent, which is >= 0.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
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 non-existent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited