From c8e4d9e2f3d73ba1fb2e15cbe1f678d85be9c76b Mon Sep 17 00:00:00 2001 From: zsw Date: Thu, 19 Sep 2024 12:29:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E6=B6=88=E6=81=AF=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/im/im_view/im_page.dart | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/im/im_view/im_page.dart b/lib/im/im_view/im_page.dart index 8661e8e5..54ca6ec9 100644 --- a/lib/im/im_view/im_page.dart +++ b/lib/im/im_view/im_page.dart @@ -102,9 +102,7 @@ class _IMPage extends State implements OnChatMessage { if (contactMap[message.fromId] == null) { /// TODO: message.fromId request Api and setState } - if (mounted) { - setState(() {}); - } + refreshState(); }); debugPrint("messages: queryList"); @@ -129,9 +127,7 @@ class _IMPage extends State implements OnChatMessage { } contactMap = contacts.lGroupBy((p0) => p0.userId).mGroupItem; - if (mounted) { - setState(() {}); - } + refreshState(); } void updateLastMessage(String userId) async {