M3EToolbarVisibilityController class

Tracks scroll / manual exit translation for a toolbar.

offset is ≤ 0 and clamped between offsetLimit and 0. Call attach from a TickerProvider (usually the toolbar state) before show / hide.

Inheritance

Constructors

M3EToolbarVisibilityController({M3ESpring motion = M3EMotion.expressiveSpatialDefault, double? exitExtent})
M3EToolbarVisibilityController.

Properties

collapsedFraction → double
0 = fully visible, 1 = fully hidden.
no setter
collapseRequested → bool
Scroll-collapse intent for M3EToolbarScrollAction.collapse, read by the toolbar to flip its own expand state (via its adjacent FAB / expand-trigger spring) the instant a scroll direction changes.
no setter
contentOffset ↔ double
Accumulated scroll delta consumed while dragging.
getter/setter pair
exitExtent ↔ double?
Optional fixed exit distance. When null, the toolbar measures itself and sets offsetLimit to -(extent + screenOffset).
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
hasListeners → bool
Whether any listeners are currently registered.
no setterinherited
isAnimating → bool
Whether a settle / show / hide spring is currently running.
no setter
isHidden → bool
Whether the toolbar is fully off-screen.
no setter
motion → M3ESpring
Spring used for show / hide / settle animations.
final
offset ↔ double
Current translation (≤ 0), clamped to [offsetLimit, 0].
getter/setter pair
offsetLimit ↔ double
Maximum negative translation (≤ 0).
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
attach(TickerProvider vsync) → void
Binds a ticker for spring show/hide. Safe to call repeatedly.
cancelAnimation() → void
Cancels an in-flight settle / show / hide spring.
detach() → void
Releases settle animation resources. Does not dispose this controller.
dispose() → void
Discards any resources used by the object.
override
hide() → void
Animates to fully hidden (offset == offsetLimit).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
requestCollapse() → void
Requests the collapse-on-scroll target. No-op if already requested.
requestExpand() → void
Reverses requestCollapse. No-op if not currently requested.
settle({required double velocity}) → void
Settles after a scroll fling using velocity threshold 150.
show() → void
Animates to fully visible (offset == 0).
toggle() → void
Toggles based on collapsedFraction midpoint.
toString() → String
A string representation of this object.
inherited

Operators

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