Skip to content

pedia/flutter-loadmore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flutter_loadmore

A widget that supports idiom of "Pull Down to Refresh & Pull Up to Load More" for ListView . Material never have this.

Getting Started

add to pubspec.yaml

flutter_loadmore: ^2.0.1
import 'package:flutter_loadmore/flutter_loadmore.dart';

  Future<List<Demo>> _handleLoadMore() {
    // fetch data async
    return widget.provider.fetchNextChunk().then((_) {
      setState(() {});
    });
  }

  Widget build(BuildContext context) {
    return LoadMore(
      onLoadMore: _handleLoadMore,
      child: ListView.builder(
        itemCount: widget.provider.data.length,
        itemBuilder: (BuildContext context, int index) {
          final item = widget.provider.data[index];
          return ListTile(title: Text(item.name));
        },
      ),
    );
  }

Full example (fetch stock via HTTPS) in example folder.

About

Pull up to load more and pull down to refresh for Flutter ListView

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published