Skip to content

Jerinji2016/infinite_scroll_view

Repository files navigation

Infinite Scoll View

pub package codecov Build Status

A flutter library for scroll views that can be scrolled in either directions infinitely.

Getting started

To install package go to your terminal and run

flutter pub add infinite_scroll_view

or add infinite_scroll_view to your pubspec.yaml

Usage

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");
    },
)

How it works

InfinitePageView

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.

TODO

  • Create InfiniteListView

Constraints

  • InfinitePageView does not support viewport fraction