FLUTTER ECOSYSTEM

BytesZero/loadany

Flutter load more package , support ListView、GridView、Slivers

loadany project cover
Stars
26
Forks
7
Last push (UTC)
May 12, 2021
Project status
Active
Zero GitHub avatar
GITHUB User

Zero ↗

Flutter & Rust & Ads

微信:toponelanBeiJingOfficial website ↗
LanguagesDartSwiftHTMLJavaKotlinObjective-C

Technical topics

Dependencies used

Dependency list 2 items
  • flutter{"sdk":"flutter"}
  • flutter_testDevelopment{"sdk":"flutter"}

Original README

English project snapshot. Visit GitHub for the latest content.

Expand / collapse project README

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
import 'package:loadany/loadany.dart';
LoadStatus status = LoadStatus.normal;

LoadAny(
  onLoadMore: getLoadMore,
  status: status,
  footerHeight: 40,
  endLoadMore: true,
  bottomTriggerDistance: 200,
  child: CustomScrollView(
    slivers: <Widget>[
      SliverGrid(...),
      SliverList(...),
    ],
  ),
)
/// Load More Get Data
Future<void> getLoadMore() async {
    setState(() {
      status = LoadStatus.loading;
    });
    Timer.periodic(Duration(milliseconds: 5000), (Timer timer) {
      timer.cancel();
      int length = list.length;
      for (var i = 1; i < 11; ++i) {
        list.add(length + i);
      }
    
      if (length > 80) {
        status = LoadStatus.completed;
      } else if (length >= 50 && length < 70) {
        status = LoadStatus.error;
      } else {
        status = LoadStatus.normal;
      }
      setState(() {});
    });
}

Getting Started

Getting Started

Screenshot

  • Loading
https://raw.githubusercontent.com/yy1300326388/loadany/develop/example/images/Kapture%2001.gif
  • Error
https://raw.githubusercontent.com/yy1300326388/loadany/develop/example/images/Kapture%2002.gif
  • Completed
https://raw.githubusercontent.com/yy1300326388/loadany/develop/example/images/Kapture%2003.gif

Issues and feedback

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

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

github juejin csdn