loop_page_view

A simple PageView builder constructor wrapper that allows for “indefinitely” scrolling on both directions.

Usage

Import the package into your code:

import 'package:loop_page_view/loop_page_view.dart';

It works exactly as a PageView builder constructor would, but it always requires an item count, and it requires LoopPageController as its controller. LoopPageController also works just as a PageController would, but it correctly handles LoopPageView indefinitely scrollable list.

Installation

dependencies:
  loop_page_view: ^1.0.9

Example

import 'package:flutter/material.dart';
import 'package:loop_page_view/loop_page_view.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('Loop Page View Demo'),
        ),
        body: Center(
          child: LoopPageView.builder(
            itemCount: 2,
            itemBuilder: (_, index) {
              return Card(
                child: Center(
                  child: Text('$index'),
                ),
              );
            },
          ),
        ),
      ),
    );
  }
}

Demo

Author

Wellington Soares Junior

License

BSD

Libraries

loop_page_view