From a9ae353e2fe49de67b4db7ad7b23dfd2949a4b90 Mon Sep 17 00:00:00 2001 From: w-R <953969641@qq.com> Date: Wed, 19 Jan 2022 18:14:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E6=81=AFbug=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/home/home_page.dart | 6 ++++-- lib/message/system_details.dart | 13 +++++-------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/lib/home/home_page.dart b/lib/home/home_page.dart index b2663c6e..3e436c43 100644 --- a/lib/home/home_page.dart +++ b/lib/home/home_page.dart @@ -246,6 +246,7 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { } } + ///消息数量 queryMsgStats() async { if (apiService == null) { SharedPreferences value = await SharedPreferences.getInstance(); @@ -365,12 +366,13 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { header: MyHeader(), physics: BouncingScrollPhysics(), onRefresh: () { - setState(() {}); + setState(() {_onRefresh(); + }); }, child: SingleChildScrollView( physics: NeverScrollableScrollPhysics(), child: FutureBuilder( - future: _onRefresh(), + future:queryHome(), builder: (context, snapshot) { return Column( children: [ diff --git a/lib/message/system_details.dart b/lib/message/system_details.dart index b27b1a19..d6efc02d 100644 --- a/lib/message/system_details.dart +++ b/lib/message/system_details.dart @@ -496,13 +496,8 @@ class _SystemDetails extends State { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - // Image.asset( - // "assets/image/c_z.png", - // width: 44.w, - // height: 44.h, - // ), MImage( - messageRelational["avatar"], + messageRelational["avatar"] ?? "", width: 44, height: 44, isCircle: true, @@ -518,7 +513,7 @@ class _SystemDetails extends State { Row( children: [ Text( - messageRelational["nickname"], + messageRelational["nickname"] ?? "", style: TextStyle( fontWeight: MyFontWeight.semi_bold, fontSize: 14.sp, @@ -562,7 +557,7 @@ class _SystemDetails extends State { // ), // ), MImage( - messageRelational["nickname"], + messageRelational["nickname"] , width: 38, height: 38, isCircle: true, @@ -880,12 +875,14 @@ class _SystemDetails extends State { } Widget followMessageItem(Message message) { var messageRelational = jsonDecode(message.relational); + if(message.relational.startsWith("{")) return Container( child: Row( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ + MImage( messageRelational["avatar"], width: 44,