From ae08ed5c9ba6e2082c998ad18cb20642562ebeb1 Mon Sep 17 00:00:00 2001 From: fmk Date: Tue, 19 Oct 2021 11:57:32 +0800 Subject: [PATCH] safety --- lib/community/community_child_page.dart | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/community/community_child_page.dart b/lib/community/community_child_page.dart index acbcf93d..0f0660a5 100644 --- a/lib/community/community_child_page.dart +++ b/lib/community/community_child_page.dart @@ -33,7 +33,7 @@ class _CommunityChildPage extends State { _onRefresh() async { pageNum = 1; - queryCommunity(); + setState(() {}); } queryCommunity() async { @@ -74,7 +74,7 @@ class _CommunityChildPage extends State { @override Widget build(BuildContext context) { return FutureBuilder( - future: _onRefresh(), + future: queryCommunity(), builder: (context, position) { return SmartRefresher( controller: refreshController, @@ -88,7 +88,9 @@ class _CommunityChildPage extends State { }, ), onRefresh: _onRefresh, - onLoading: queryCommunity, + onLoading: () { + setState(() {}); + }, child: ListView.builder( physics: NeverScrollableScrollPhysics(), itemBuilder: (context, position) {