From 3d5c578fefcf581b83ec0aa6377dcddc1dcfe90e Mon Sep 17 00:00:00 2001 From: guozhigq Date: Fri, 16 Feb 2024 11:00:23 +0800 Subject: [PATCH] =?UTF-8?q?mod:=20=E5=8A=A8=E6=80=81=E9=A1=B5=E9=9D=A2upPa?= =?UTF-8?q?nel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/dynamics/widgets/up_panel.dart | 35 ++++++++++++++---------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/lib/pages/dynamics/widgets/up_panel.dart b/lib/pages/dynamics/widgets/up_panel.dart index f1043fd8..84753ff9 100644 --- a/lib/pages/dynamics/widgets/up_panel.dart +++ b/lib/pages/dynamics/widgets/up_panel.dart @@ -36,8 +36,7 @@ class _UpPanelState extends State { } upList.insert( 0, - UpItem( - face: 'https://files.catbox.moe/8uc48f.png', uname: '全部动态', mid: -1), + UpItem(face: '', uname: '全部动态', mid: -1), ); userInfo = userInfoCache.get('userInfoCache'); upList.insert( @@ -56,7 +55,7 @@ class _UpPanelState extends State { floating: true, pinned: false, delegate: _SliverHeaderDelegate( - height: 124, + height: 126, child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, @@ -178,6 +177,9 @@ class _UpPanelState extends State { }, onLongPress: () { feedBack(); + if (data.mid == -1) { + return; + } String heroTag = Utils.makeHeroTag(data.mid); Get.toNamed('/member?mid=${data.mid}', arguments: {'face': data.face, 'heroTag': heroTag}); @@ -205,12 +207,19 @@ class _UpPanelState extends State { backgroundColor: data.type == 'live' ? Theme.of(context).colorScheme.secondaryContainer : Theme.of(context).colorScheme.primary, - child: NetworkImgLayer( - width: 49, - height: 49, - src: data.face, - type: 'avatar', - ), + child: data.face != '' + ? NetworkImgLayer( + width: 50, + height: 50, + src: data.face, + type: 'avatar', + ) + : const CircleAvatar( + radius: 25, + backgroundImage: AssetImage( + 'assets/images/noface.jpeg', + ), + ), ), Padding( padding: const EdgeInsets.only(top: 4), @@ -278,13 +287,11 @@ class UpPanelSkeleton extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, children: [ Container( - width: 49, - height: 49, + width: 50, + height: 50, decoration: BoxDecoration( color: Theme.of(context).colorScheme.onInverseSurface, - borderRadius: const BorderRadius.all( - Radius.circular(24), - ), + borderRadius: BorderRadius.circular(50), ), ), Container(