infinite_view_pager 1.0.0

Flutter Android iOS web

Infinite View Pager widget for Flutter

infinite_view_pager #

Flutter infinite view pager widget

GitHub stars Twitter Follow

Demo

Installation #

dependencies:
  infinite_view_pager: ^1.0.0

Example #

class InfiniteViewPagerDemo extends StatefulWidget {
  @override
  _InfiniteViewPagerDemoState createState() => _InfiniteViewPagerDemoState();
}

class _InfiniteViewPagerDemoState extends State<InfiniteViewPagerDemo> {
  int index = 0;

  Widget _buildPage(BuildContext context, int direction) {
    return Container(
      padding: EdgeInsets.all(100.0),
      child: Card(
        shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.circular(20.0),
        ),
        elevation: 10,
        child: Center(
          child: Text(
            (index + direction).toString(),
            style: Theme.of(context).textTheme.display4,
          ),
        ),
      ),
    );
  }

  @override
  Widget build(BuildContext context) {
    return Container(
      child: InfinitePageView(
        onPageChanged: (direction) {
          index += direction;
        },
        pageBuilder: _buildPage,
        scrollDirection: Axis.vertical,
      ),
    );
  }
}

Author #

Andrei Lesnitsky

License #

MIT

GitHub stars Twitter Follow

2
likes
90
pub points
66%
popularity

Publisher

lesnitsky.dev

Infinite View Pager widget for Flutter

Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on infinite_view_pager