A flutter library for scroll views that can be scrolled in either directions infinitely.
To install package go to your terminal and run
flutter pub add infinite_scroll_view
or add infinite_scroll_view
to your pubspec.yaml
Using InfinitePageView
InfinitePageView(
onPageChanged: (index) {
print('$index');
},
itemBuilder: (context, index) {
return Text("Page $index");
},
)
Use a controller to take control over InfinitePageView
final InfinitePageController controller = InfinitePageController();
// ...
InfinitePageView(
controller: controller,
itemBuilder: (context, index) {
return Text("Page $index");
},
)
Works by creating a PageView with 2 pages which in turn are PageViews. Both PageViews are respectively controlled under the hood to get the desired working.
- Create InfiniteListView
- InfinitePageView does not support viewport fraction