From 21fe663add142a80baee752f238d4b1f053bdf18 Mon Sep 17 00:00:00 2001 From: guozhigq Date: Sat, 27 Apr 2024 22:17:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=90=88=E9=9B=86cover=20null?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/common/pages_bottom_sheet.dart | 46 +++++++++++++++++++----------- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/lib/common/pages_bottom_sheet.dart b/lib/common/pages_bottom_sheet.dart index 54f14654..00233a07 100644 --- a/lib/common/pages_bottom_sheet.dart +++ b/lib/common/pages_bottom_sheet.dart @@ -45,25 +45,37 @@ class EpisodeBottomSheet { title = '第${episode.title}话 ${episode.longTitle!}'; break; } - return InkWell( - onTap: () { - SmartDialog.showToast('切换至「$title」'); - changeFucCall.call(episode, index); - }, - child: Padding( - padding: const EdgeInsets.only(left: 14, right: 14, top: 8, bottom: 8), - child: isFullScreen - ? Text( - title, - maxLines: 1, + return isFullScreen || episode?.cover == null + ? ListTile( + onTap: () { + SmartDialog.showToast('切换至「$title」'); + changeFucCall.call(episode, index); + }, + dense: false, + leading: isCurrentIndex + ? Image.asset( + 'assets/images/live.gif', + color: primary, + height: 12, + ) + : null, + title: Text(title, style: TextStyle( fontSize: 14, color: isCurrentIndex ? primary : onSurface, - ), - ) - : Row( + ))) + : InkWell( + onTap: () { + SmartDialog.showToast('切换至「$title」'); + changeFucCall.call(episode, index); + }, + child: Padding( + padding: + const EdgeInsets.only(left: 14, right: 14, top: 8, bottom: 8), + child: Row( children: [ - NetworkImgLayer(width: 130, height: 75, src: episode.cover), + NetworkImgLayer( + width: 130, height: 75, src: episode?.cover ?? ''), const SizedBox(width: 10), Expanded( child: Text( @@ -77,8 +89,8 @@ class EpisodeBottomSheet { ), ], ), - ), - ); + ), + ); } Widget buildTitle() {