项目作者: yy1300326388

项目描述 :
Flutter load more package , support ListView、GridView、Slivers
高级语言: Dart
项目地址: git://github.com/yy1300326388/loadany.git
创建时间: 2019-07-23T15:15:00Z
项目社区:https://github.com/yy1300326388/loadany

开源协议:Apache License 2.0

下载


LoadAny

A new Flutter loads more package.

Website

中文说明

Codemagic build status

Support

  • CustomScrollView
  • SliverListView
  • SliverGridView
  • SliverListView substitute ListView
  • SliverGridView substitute GridView
  • Custom loading style
  • External nested RefreshIndicator
  • Feed streaming

Usage

  • Add LoadAny
  1. import 'package:loadany/loadany.dart';
  1. LoadStatus status = LoadStatus.normal;
  2. LoadAny(
  3. onLoadMore: getLoadMore,
  4. status: status,
  5. footerHeight: 40,
  6. endLoadMore: true,
  7. bottomTriggerDistance: 200,
  8. child: CustomScrollView(
  9. slivers: <Widget>[
  10. SliverGrid(...),
  11. SliverList(...),
  12. ],
  13. ),
  14. )
  1. /// Load More Get Data
  2. Future<void> getLoadMore() async {
  3. setState(() {
  4. status = LoadStatus.loading;
  5. });
  6. Timer.periodic(Duration(milliseconds: 5000), (Timer timer) {
  7. timer.cancel();
  8. int length = list.length;
  9. for (var i = 1; i < 11; ++i) {
  10. list.add(length + i);
  11. }
  12. if (length > 80) {
  13. status = LoadStatus.completed;
  14. } else if (length >= 50 && length < 70) {
  15. status = LoadStatus.error;
  16. } else {
  17. status = LoadStatus.normal;
  18. }
  19. setState(() {});
  20. });
  21. }

Getting Started

Getting Started

Screenshot

  • Loading

  • Error

  • Completed

Issues and feedback

Please file issues to send feedback or report a bug. Thank you!

关注我

  • 遇到问题可以找我帮助解决(联系方式在 GitHub 主页)
  • 持续分享优质的 Flutter 文章和视频
  • 不定期分享 Flutter 开发小技巧
  • 百万级 Flutter 应用架构经验



github


juejin


csdn