flutter ListView加载更多

Expanded(
                      child: MediaQuery.removePadding( // 去除ListView产生的顶部空白
                        removeTop: true,
                        context: context,
                        child: EasyRefresh( // 这个包在ListView的外边,需要加载的列表
                          refreshFooter: ClassicsFooter(
                            key: _footerKey,
                            bgColor: Colors.white,
                            textColor: Colors.red,
                            moreInfoColor: Colors.red,
                            showMore: true,
                            noMoreText: '没有数据了',
                            moreInfo: "加载更多",
                            //
                            loadReadyText: "加载中", // 上拉加载
                          ),
                          child: ListView( // 内容主体部分
                            shrinkWrap: true,
                            children: [
                              Container(
                                decoration: BoxDecoration(
                                  color: Colors.grey,
                                  borderRadius: BorderRadius.only(
                                      bottomLeft: Radius.circular(10.0),
                                      bottomRight: Radius.circular(10.0)), //
                                ),
                                child: Container(
                                    padding: EdgeInsets.all(10),
                                    child: messageButtonBox()
                                ),
                              ),
                            Expanded(
//                              height: 400,
                              child: cardBoxList(),
                            )

                            ],
                          ),
                          loadMore: () async {
//                            _loadData();
                          },
                        ),
                      )
                  )

 

posted @ 2020-09-07 15:52  lude1994  阅读(635)  评论(0)    收藏  举报