• Stars
    star
    242
  • Rank 167,048 (Top 4 %)
  • Language
    Dart
  • License
    Apache License 2.0
  • Created about 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

flutter loadmore demos

loadmore

pub package GitHub

A loadMore library

Support ListView and SliverList

中文构思思路和使用说明可以看简书

screenshot

img

whole example

show https://github.com/CaiJingLong/flutter_listview_loadmore

install

in pubspec.yaml

dependencies:
  loadmore: ^2.0.1

import in dartfile:

import 'package:loadmore/loadmore.dart';

use in build:

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: new Text(widget.title),
      ),
      body: Container(
        child: LoadMore(
          isFinish: count >= 60,
          onLoadMore: _loadMore,
          child: ListView.builder(
            itemBuilder: (BuildContext context, int index) {
              return Container(
                child: Text(list[index].toString()),
                height: 40.0,
                alignment: Alignment.center,
              );
            },
            itemCount: count,
          ),
        ),
      ),
    );
  }

  Future<bool> _loadMore() async {
    print("onLoadMore");
    await Future.delayed(Duration(seconds: 0, milliseconds: 100));
    load();
    return true;
  }

properties use:

child: Widget ,required , support ListView ListView.builder ListView.separated, other is not support.
onLoadMore:required A Function , `typedef Future<bool> FutureCallBack();` , reture true is success and status delay,return false or null ,then the status will change to fail.
isFinish: bool, optional, if true, then the status will change to finish ,default is false
delegate: LoadMoreDelegate,optional, see the LoadMoreDelegate class,default is DefaultLoadMoreDelegate
textBuilder: optional, the result will show in loading view ,if you use default delegate. default is DefaultLoadMoreText.chinese,
whenEmptyLoad: bool ,optional, default is true, when [whenEmptyLoad] is true, and when listView children length is 0,or the itemCount is 0,not build loadMoreWidget.
abstract class LoadMoreDelegate {
  const LoadMoreDelegate();

  double widgetHeight(LoadMoreStatus status) => _defaultLoadMoreHeight; // the loadMore height. default is 80.0

  Duration loadMoreDelay() => Duration(milliseconds: _loadMoreDelay);// When widget is created, the refresh delay time is triggered.

  Widget buildChild(LoadMoreStatus status); // build your widget in the loadmore widget.
}

other

homePage: https://github.com/CaiJingLong/flutter_listview_loadmore emailto me : [email protected]

LICENSE

APACHE 2.0

More Repositories

1

Flutter-Notebook

FlutterDemo合集,今天你fu了吗
Dart
7,138
star
2

flutter_screenutil

Flutter screen adaptation, font adaptation, get screen information
Dart
3,883
star
3

fluwx

Flutter版微信SDK.WeChat SDK for flutter.
Dart
3,059
star
4

tobias

AliPay For Flutter.支付宝Flutter插件
Objective-C
678
star
5

PullToRefresh

Flutter相关的项目QQ:277155832 Email:[email protected]
Dart
472
star
6

k_chart

Maybe it is the best k chart in Flutter.
Dart
459
star
7

flutter_oktoast

a pure flutter toast library
Dart
457
star
8

Pangolin

🐾 Flutter 广告SDK-字节跳动-穿山甲 集成
Java
332
star
9

OpenFlutter

Love flutter love life.QQ群:892398530
301
star
10

flutter_share_me

Flutter Plugin for sharing contents to social media. You can use it share to Facebook , WhatsApp , Twitter And System Share UI. Support Url and Text.
Swift
151
star
11

nautilus

阿里百川电商Flutter插件。
Objective-C
130
star
12

mini_calendar

Date component developed with Flutter, plans to support display, swipe left and right, add date mark, radio, display week, etc.
Dart
114
star
13

mmkv_flutter

get or set persistent storage value based on MMKV framework.
Dart
101
star
14

flutter_im_demo

📞 Flutter 使用 MQTT实现IM功能
Dart
82
star
15

flutter_gesture_password

flutter_gesture_password
Dart
78
star
16

rammus

Flutter Plugin for AliCloud Push.阿里云推送插件
Kotlin
77
star
17

neeko

Flutter video player widget based on video_player
Dart
70
star
18

FlutterInAction

Flutter In Action.Flutter实践。
46
star
19

flutter_ok_image

a flutter image widget to load image.
Dart
40
star
20

flutter_database_demo

🛠 Flutter 本地数据库存储 + 状态管理
Dart
35
star
21

sona

@Deprecated Not maintained. Developers who need Getui push please visit official plugins
Objective-C
35
star
22

tencent_cos

Flutter plugin for cos
Java
23
star
23

flutter_paging

Paging like android jetpack
Dart
11
star
24

flutter_navigation_bar

解决官方例子会不停销毁重建的问题
Dart
10
star
25

kart

A kotlin-style extension collection for dart.
Dart
7
star
26

flutter_ali_face_verify

Flutter plugin for Ali face verify
Dart
1
star