1 Star 1 Fork 1

OpenFlutter / flutter_paging

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

flutter_paging pub package

分布加载,实现数据与UI解耦。

Note: 这个项目还处于开发阶段. 欢迎Pull Requests.

安装

首先, 添加 flutter_paging,参加dependency in your pubspec.yaml file.

Widgets

  • PagingView : 分页组件基础控件.

  • PagingListView : PagingView的子类,包裹了ListView.

KeyedDataSource

KeyedDataSource 分页的核心,数据的获取由dataSource完成。

Note: 不要忘记调用 dataSource.init()

Example


  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Paging ListView"),
      ),
      body: RefreshIndicator(
        onRefresh: widget.dataSource.refresh,
        child: PagingListView<String>.builder(
          itemBuilder: (context, index, item) {
            return Card(
                child: Padding(
              padding: const EdgeInsets.all(8.0),
              child: Text("paging->$item"),
            ));
          },
          dataSource: widget.dataSource,
          loadingIndicator: Center(
            child: Padding(
              padding: const EdgeInsets.all(8.0),
              child: CircularProgressIndicator(),
            ),
          ),
          noMoreDataAvailableItem: Center(
            child: Padding(
              padding: const EdgeInsets.all(8.0),
              child: Text("no more data avaliable~"),
            ),
          ),
        ),
      ),
    );
  }

空文件

简介

Flutter 分页加载。 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/OpenFlutter/flutter_paging.git
git@gitee.com:OpenFlutter/flutter_paging.git
OpenFlutter
flutter_paging
flutter_paging
master

搜索帮助