StickyHeaderController class
Sticky Header Controller.
StickyHeaderController is the core of the library, its main feature is to monitor the scroll changes and calculate the sticky header. In addition to this, it also supports jumping the header widget of the specified index, see also animateTo.
- Inheritance
-
- Object
- ChangeNotifier
- StickyHeaderController
Constructors
Properties
- currentChildStickyHeaderInfo ↔ StickyHeaderInfo?
-
Current child sticky header information.
getter/setter pair
- currentOffset ↔ Offset
-
Current sticky header offset.
getter/setter pair
- currentPixels ↔ double
-
Cache of pixel values for the current scroll position
getter/setter pair
- currentStickyHeaderInfo ↔ StickyHeaderInfo?
-
Current sticky header information.
getter/setter pair
- getMaxScrollExtent → double
-
no setter
- getMinScrollExtent → double
-
no setter
- getViewportDimension → double
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- isHorizontalAxis → bool
-
no setter
- isJumping ↔ bool
-
getter/setter pair
- isReverse → bool
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollPosition ↔ ScrollPosition?
-
getter/setter pair
- useStickyAmount ↔ bool
-
When the value of the useStickyAmount property is set to true, the
sticky amount of the header widget will be automatically calculated.
getter/setter pair
Methods
-
addCallback(
StickyHeaderInfoCallback callback) → void -
When the header widget is attached to the widget tree, which will execute
this method to add its own callback to the list. When the page is
scrolled, a callback will be executed to get StickyHeaderInfo to
determine the position of
StickyHeaderWidget
. -
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
animateTo(
int index, {double offset = 0.0, double velocity = 1.0, Duration? duration, Curve? curve, Duration? findingStartDuration, Curve? findingStartCurve, Duration? findingEndDuration, Curve? findingEndCurve}) → void - Jumps to the header widget of the specified index. Compared with jumpTo, a transition animation is added and it supports jumping to the header widget that has not yet appeared.
-
clearStickyHeaderInfo(
) → void - Clears the cache, please call when needed.
-
dispose(
) → void -
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
override
-
getComponent(
Offset offset) → double - Gets the horizontal or vertical component based on the scroll view's scroll axis.
-
getDimension(
Size? size) → double - Gets the width or height based on scroll view's scroll axis.
-
getStickyHeaderInfo(
int index) → StickyHeaderInfo? - Gets sticky header information from cache.
-
jumpTo(
int index, {double offset = 0.0}) → bool - Jumps to the header widget of the specified index.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
removeCallback(
StickyHeaderInfoCallback callback) → void - When the header widget is detached from the widget tree, which will execute this method to remove its own callback to the list.
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
scrollListener(
) → void - Monitors scroll changes and control the position and visibility of the sticky header widget based on the scroll position.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited