flutter_refresh_loadmore 0.1.8
flutter_refresh_loadmore: ^0.1.8

Flutter Android iOS web

A refresh loadmore listview package. can pull refresh listview and loadmore ,use the libray listview swrap form the new widget.

flutter_refresh_loadmore #

A refresh loadmore listview package.

Getting Started #

Installing

flutter_refresh_loadmore: ^0.1.8

Import

import 'package:flutter_refresh_loadmore/flutter_refresh_loadmore.dart';

How To Use

    GlobalKey<ListViewRefreshLoadMoreWidgetState> _listViewKey = new GlobalKey();
    bool hasMoreData = true;
  
    Widget getList() {
      return ListViewRefreshLoadMoreWidget(
        key: _listViewKey,
        //listview  count
        itemCount: newsList.length,
  
        //listview 的item widget
        swrapInsideWidget: (buildContex, index) {
          return _widgetRow(index);
        },
        //下拉刷新
        refrshCallback: () async {
          await getNewsList(true, "", getCallbackAndSetData2(true));//获取数据 添加到newsList
          _listViewKey.currentState.changeData(newsList.length);
        },
        //加载更多
        loadMoreCallback: () async {
          await getNewsList(false, newsList.last.time, getCallbackAndSetData2(false)); //获取数据 添加到newsList
          _listViewKey.currentState.changeData(newsList.length,hasMoreData: hasMoreData);
        },
  
        /// 加载更多 用
        hasMoreData: hasMoreData,
  //    ///footer widget 非必须传有默认
  //    footerWidget: (statusStr){
  //      return null;
  //    },
  //    //head widget 非必传有默认
  //    headWidget: (headstate,currentHeight){
  //    return null;
  //    ;
  //    },
      );
    }

下拉默认刷新效果

image

加载默认更多效果

image

2
likes
85
pub points
58%
popularity

A refresh loadmore listview package. can pull refresh listview and loadmore ,use the libray listview swrap form the new widget.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

liuwangle1789@gmail.com

License

BSD (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_refresh_loadmore