infinite_listview 1.0.0

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new76

Flutter Community

Flutter Infinite ListView

pub package

ListView with items that can be scrolled infinitely in both directions.

Quick Usage

Replace your existing ListView with InfiniteListView. Builder pattern must be used because of its infinite nature.

Example

Example

Bugs/Requests

If you encounter any problems feel free to open an issue. If you feel the library is missing a feature, please raise a ticket on Github and I'll look into it. Pull Request are also welcome.

1.0.0

  • Initial release.

example/lib/main.dart

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

void main() => runApp(ExampleApp());

class ExampleApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: ExampleScreen(),
    );
  }
}

class ExampleScreen extends StatefulWidget {
  @override
  _ExampleScreenState createState() => _ExampleScreenState();
}

class _ExampleScreenState extends State<ExampleScreen> {
  final InfiniteScrollController _infiniteController = InfiniteScrollController(
    initialScrollOffset: 0.0,
  );

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Example'),
        actions: <Widget>[
          IconButton(
            icon: const Icon(Icons.arrow_downward),
            onPressed: () {
              _infiniteController.animateTo(_infiniteController.offset + 2000.0, duration: const Duration(milliseconds: 250), curve: Curves.easeIn);
            },
          ),
          IconButton(
            icon: const Icon(Icons.arrow_upward),
            onPressed: () {
              _infiniteController.animateTo(_infiniteController.offset - 2000.0, duration: const Duration(milliseconds: 250), curve: Curves.easeIn);
            },
          ),
        ],
      ),
      body: InfiniteListView.separated(
        controller: _infiniteController,
        itemBuilder: _buildItem,
        separatorBuilder: (BuildContext context, int index) => const Divider(height: 2.0),
      ),
    );
  }

  Widget _buildItem(BuildContext context, int index) {
    return Material(
      child: InkWell(
        onTap: () {},
        child: ListTile(
          title: Text('Item #$index'),
          subtitle: Text('Subtitle $index'),
          trailing: const Icon(Icons.chevron_right),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  infinite_listview: ^1.0.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:infinite_listview/infinite_listview.dart';
  
Version Uploaded Documentation Archive
1.0.0 Nov 22, 2018 Go to the documentation of infinite_listview 1.0.0 Download infinite_listview 1.0.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
52
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
76
Learn more about scoring.

We analyzed this package on Dec 5, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.7
  • Flutter: 1.0.0

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test