LoopPageController class
A PageController extension to handle an infinitely scrollable list in LoopPageView.
- Implemented types
Constructors
- LoopPageController({int initialPage = 0, bool keepPage = true, double viewportFraction = 1.0, LoopScrollMode scrollMode = LoopScrollMode.shortest, LoopActivationMode activationMode = LoopActivationMode.immediate})
-
Creates a LoopPageController with an immediate looping activation mode.
It enables infinite looping behavior right from the first page.
It allows setting a scroll mode, defaulting to the shortest path between pages.
You can set the
LoopActivationMode
to start looping immediately, only after the first loop, or to only enable infinite loops going forward. Based on this mode, the controller will adjust the scroll mode and initial page.
Properties
- hasClients → bool
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
no setter
- initialPage → int
-
final
- initialScrollOffset → double
-
no setter
- keepScrollOffset → bool
-
no setter
- offset → double
-
no setter
- page → double
-
The current page displayed in the controlled LoopPageView.
no setter
- position → ScrollPosition
-
no setter
-
positions
→ Iterable<
ScrollPosition> -
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollMode ↔ LoopScrollMode
-
getter/setter pair
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object notifies its listeners.
override
-
animateJumpToPage(
int page, {required Duration duration, required Curve curve}) → Future< void> - Jumps to imediate before or after given page and then animates the controlled LoopPageView from the imediate page to the given page. This is done in order to build only the given page while still animating its transition.
-
animateToPage(
int page, {required Duration duration, required Curve curve}) → Future< void> - Animates the controlled LoopPageView from the current page to the given page.
-
attach(
ScrollPosition position) → void -
createScrollPosition(
ScrollPhysics physics, ScrollContext context, ScrollPosition oldPosition) → ScrollPosition -
dispose(
) → void -
jumpToPage(
int page) → void - Changes which page is displayed in the controlled LoopPageView.
-
nextPage(
{required Duration duration, required Curve curve}) → Future< void> - Animates the controlled LoopPageView to the next page.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
previousPage(
{required Duration duration, required Curve curve}) → Future< void> - Animates the controlled LoopPageView to the previous page.
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that the
object notifies.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited