Buscar pacotes, repositórios e categorias de apps

Repositório GitHubdangngocduc/flutter_paging

flutter_paging

Uma pequena biblioteca que oferece suporte ao carregamento infinito para ListView - GridView no Flutter.

Capa do projeto flutter_paging
Estrelas
32
Forks
10
Último push (UTC)
30 de jan. de 2026
Status do projeto
Ativo

README original

Texto original em inglês. Visite o GitHub para a versão atual.

Paging

Pub Package
Star on GitHub style: effective dart MIT License


A Flutter package that supports pagination(load infinite) for ListView, GridView

Demo
DataSource
PageKeyedDataSource

To create a PagingListView or PagingGridView you will need create class which extended from PageKeyedDataSource.

When extended from PageKeyedDataSource, you will need override 2 methods is loadInitial and loadPageAfter.

Output of those function is a Tuple2 with item1 is List is List of data, end item2 is next page index.

Example: if your list start with page index is 0. -> on loadInitial output is Tuple2([...], 1) 1 is next page when load more item.

Example:

class ListViewDataSource extends paging.PageKeyedDataSource<int, Note> {
  NoteRepository noteRepository;

  ListViewDataSource(this.noteRepository);

  @override
  Future<Tuple2<List<Note>, int>> loadInitial(int pageSize) async {
    return Tuple2(await noteRepository.getNotes(0), 1);
  }

  @override
  Future<Tuple2<List<Note>, int>> loadPageAfter(int params, int pageSize) async {
    return Tuple2(await noteRepository.getNotes(params), params + 1);
  }
}
Display on UI

To display on UI, currently you can use PagingListView or PagingGridView.

Example:

      ListViewDataSource dataSource = ListViewDataSource(NoteRepository());

      PagingListView<Note>(
        itemBuilder: (context, data, child) => NoteWidget(data),
        pageDataSource: dataSource,
      ),

Đặng Ngọc Đức GitHub avatar
Autor no GitHub

Đặng Ngọc Đức ↗

Flutter Developer

Hà Nội, Việt NamSite oficial ↗
LinguagensDartC++CMakeSwiftCHTMLKotlinObjective-C

Categorias

Pacotes publicados por este repositório

Dependências usadas

Lista de dependências 7 itens

Como escolher um repositório para seu projeto?

Filtre pelo caso de uso, compare a atividade e confira o projeto original antes de adotá-lo.

  1. Busque por nome, autor ou descrição e filtre por tema.
  2. Compare estrelas, forks e envios recentes. Estrelas indicam interesse, mas não garantem qualidade.
  3. Confira o README, a licença e as issues no GitHub antes de usar o projeto.

Fontes e manutenção

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗