搜索插件、代码仓与 APP 分类

list_load_more 封面
插件详情v1.0.1

list_load_more

一个易于实现的懒加载 ListView,易于自定义您自己的加载动画,并支持添加、删除单个项目以及聚焦到项目等功能。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
13
喜欢数
57
Pub 分数
140

安装插件

flutter pub add list_load_more

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

ListLoadMore 是一个 Flutter 包,可简化 ListView 中的懒加载实现,通过最少的设置即可实现无缝分页。它支持自定义加载动画,并提供添加或删除单个项目以及聚焦特定列表条目的功能。设计注重易用性和高度定制化,可在 Android、iOS、Web、macOS、Windows 和 Linux 等所有主要平台上运行。适用于需要动态内容加载但又不牺牲性能或用户体验的应用。

适合场景

  • 无限滚动信息流
  • 动态数据列表
  • 可自定义的加载指示器
  • 实时数据更新
  • 用户驱动的项目管理
  • 流畅的滚动体验

主要特点

  • 与 ListView 的轻松集成
  • 可自定义的加载动画
  • 支持项目添加/删除
  • 聚焦控制特定项目
  • 跨平台兼容性
  • 最少的样板代码

适合对象

  • 开发分页列表的开发者
  • 动态内容的应用程序
  • 需要流畅加载的UI密集型应用
  • 注重快速开发的团队
  • 需要可自定义加载状态的项目
  • 跨平台 Flutter 应用

使用建议

  • 需要手动处理数据源逻辑
  • 有限的内置错误处理
  • 自定义动画若未经优化,可能影响性能
  • 对于非常大的数据集,若无额外优化,则不理想
  • 依赖外部状态管理来处理复杂场景

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

A beautiful ListLoadMore easy to use and customize.

List Load More

DEMO

Usage

Simple implementation:
        final GlobalKey<ListLoadMoreState> _key = GlobalKey();
        ListLoadMore<Employee>(
            key: _key
            status: ListLoadMoreStatus.none,
            total: totalItem,
            itemBuilder: (item, index) => _employeeWidget(item),
            onLoadMore: (int currentTotal) async {
              // call your API load more here with currentTotal is total item we have
            },
            onRefresh: () async {
              // call API refresh here
            },
        )
Then you can add your new items to ListLoadMore:
       _key.currentState?.addData(yourNewItemList);
Or you can add single, remove single item:
       _key.currentState?.addItem(item: yourItem, index: 0);
       _key.currentState?.removeItem(index: 0);
You can focus to specific index:
       _key.currentState?.focusToIndex(index);

License

Copyright (c) 2021 Tuannvm

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

所属分类

依赖

依赖清单 2 项

源码仓库

使用此插件的项目

暂无相关数据。