Skip to content

radzish/flutter_paging_list

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flutter_paging_list

Paging List Library for Flutter. List that lazily loads more data when scrolled to first/last item.

Usage

Define Data Source

class ExampleDataSource extends PagingDataSource<ExampleItem> {

  ExampleDataSource() : super(10 /*page size*/);

  Future<List<ExampleItem>> loadBefore(ExampleItem item, int limit) {
    //return data before that goes before item; initially item will always be null
  }

  Future<List<ExampleItem>> loadAfter(ExampleItem item, int limit) {
    //return data that goes after item; initially item will always be null
  }
  
}

Initialize Data Source:

  @override
  void initState() {
    super.initState();
    dataSource = ExampleDataSource();
  }

Build List

  Widget build(BuildContext context) {
    return new PagingListView<ExampleItem>(
      dataSource: dataSource,
      builder: (BuildContext context, ExampleItem item) {
         //create and return widget for corresponding item
      },
    );
  }

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages