|
|
|
@ -39,7 +39,7 @@ class _CommunityChildList extends State<CommunityChildList> {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
_onRefresh() async { |
|
|
|
|
setState(() {}); |
|
|
|
|
queryCommunity(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
///动态列表 |
|
|
|
@ -71,23 +71,25 @@ class _CommunityChildList extends State<CommunityChildList> {
|
|
|
|
|
refreshController.refreshCompleted(); |
|
|
|
|
refreshController.loadComplete(); |
|
|
|
|
if (baseData.isSuccess) { |
|
|
|
|
if (pageNum == 1) { |
|
|
|
|
comments.clear(); |
|
|
|
|
} |
|
|
|
|
comments.addAll(baseData.data.list); |
|
|
|
|
// comments.sort((a,b)=>b.createTime.compareTo(a.createTime)); |
|
|
|
|
// print("comments: ${comments.length}"); |
|
|
|
|
if (int.tryParse(baseData.data.total) < (pageNum * 10)) { |
|
|
|
|
refreshController.loadNoData(); |
|
|
|
|
} |
|
|
|
|
setState(() { |
|
|
|
|
if (pageNum == 1) { |
|
|
|
|
comments.clear(); |
|
|
|
|
} |
|
|
|
|
comments.addAll(baseData.data.list); |
|
|
|
|
// comments.sort((a,b)=>b.createTime.compareTo(a.createTime)); |
|
|
|
|
// print("comments: ${comments.length}"); |
|
|
|
|
if (int.tryParse(baseData.data.total) < (pageNum * 10)) { |
|
|
|
|
refreshController.loadNoData(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
Widget build(BuildContext context) { |
|
|
|
|
return FutureBuilder( |
|
|
|
|
future: queryCommunity(), |
|
|
|
|
builder: (context, position) { |
|
|
|
|
// return FutureBuilder( |
|
|
|
|
// future: queryCommunity(), |
|
|
|
|
// builder: (context, position) { |
|
|
|
|
return SmartRefresher( |
|
|
|
|
controller: refreshController, |
|
|
|
|
enablePullDown: true, |
|
|
|
@ -102,7 +104,7 @@ class _CommunityChildList extends State<CommunityChildList> {
|
|
|
|
|
onRefresh: _onRefresh, |
|
|
|
|
onLoading: () { |
|
|
|
|
isLoadMore = true; |
|
|
|
|
setState(() {}); |
|
|
|
|
_onRefresh(); |
|
|
|
|
}, |
|
|
|
|
scrollController: scrollController, |
|
|
|
|
child: Container( |
|
|
|
@ -119,9 +121,7 @@ class _CommunityChildList extends State<CommunityChildList> {
|
|
|
|
|
0, |
|
|
|
|
isList: true, |
|
|
|
|
exitFull: () { |
|
|
|
|
setState(() { |
|
|
|
|
_onRefresh(); |
|
|
|
|
}); |
|
|
|
|
_onRefresh(); |
|
|
|
|
}, |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
@ -130,7 +130,7 @@ class _CommunityChildList extends State<CommunityChildList> {
|
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
}, |
|
|
|
|
); |
|
|
|
|
// }, |
|
|
|
|
// ); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|