ScrollAdapter class
Drives an Animate animation from a ScrollController.
Set direction to ScrollDirection.forward or ScrollDirection.reverse to only trigger updates when the scroll position increases or decreases respectively.
begin and end adjust the pixel range for the scroll to update the animation
within. Values <0
are calculated relative to the end of the scroll.
They default to minScrollExtent
and maxScrollExtent
respectively.
For example, this starts fading/sliding in the text once the list scrolls to 100px, and finishes 200px before the end of the scroll:
ListView(
controller: scrollController,
children: items,
);
Text("Hello").animate(
adapter: ScrollAdapter(
scrollController,
begin: 100, // relative to start of scroll
end: -200, // relative to end
)
).fadeIn().slide();
Constructors
- ScrollAdapter(ScrollController scrollController, {double? begin, double? end, bool? animated, Direction? direction})
Properties
- animated → bool
-
finalinherited
- begin → double?
-
final
- direction → Direction?
-
finalinherited
- end → double?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollController → ScrollController
-
final
Methods
-
attach(
AnimationController controller) → void -
override
-
config(
AnimationController controller, double value, {ChangeNotifier? notifier, VoidCallback? listener}) → void -
inherited
-
detach(
) → void -
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
updateValue(
double value) → void -
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited