diff --git a/lib/common/skeleton/video_card_h.dart b/lib/common/skeleton/video_card_h.dart index e02b34b5d..ca508c7f8 100644 --- a/lib/common/skeleton/video_card_h.dart +++ b/lib/common/skeleton/video_card_h.dart @@ -39,51 +39,55 @@ class VideoCardHSkeleton extends StatelessWidget { ), // VideoContent(videoItem: videoItem) Expanded( - child: Padding( - padding: const EdgeInsets.fromLTRB(10, 4, 6, 4), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - color: Theme.of(context).colorScheme.onInverseSurface, - width: 200, - height: 11, - margin: const EdgeInsets.only(bottom: 5), - ), - Container( - color: Theme.of(context).colorScheme.onInverseSurface, - width: 150, - height: 13, - ), - const Spacer(), - Container( - color: Theme.of(context).colorScheme.onInverseSurface, - width: 100, - height: 13, - margin: const EdgeInsets.only(bottom: 5), - ), - Row( - children: [ - Container( - color: Theme.of(context) - .colorScheme - .onInverseSurface, - width: 40, - height: 13, - margin: const EdgeInsets.only(right: 8), - ), - Container( - color: Theme.of(context) - .colorScheme - .onInverseSurface, - width: 40, - height: 13, - ), - ], - ) - ], + child: Padding( + padding: const EdgeInsets.fromLTRB(10, 4, 6, 4), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + color: + Theme.of(context).colorScheme.onInverseSurface, + width: 200, + height: 11, + margin: const EdgeInsets.only(bottom: 5), + ), + Container( + color: + Theme.of(context).colorScheme.onInverseSurface, + width: 150, + height: 13, + ), + const Spacer(), + Container( + color: + Theme.of(context).colorScheme.onInverseSurface, + width: 100, + height: 13, + margin: const EdgeInsets.only(bottom: 5), + ), + Row( + children: [ + Container( + color: Theme.of(context) + .colorScheme + .onInverseSurface, + width: 40, + height: 13, + margin: const EdgeInsets.only(right: 8), + ), + Container( + color: Theme.of(context) + .colorScheme + .onInverseSurface, + width: 40, + height: 13, + ), + ], + ) + ], + ), ), - )), + ), ], ), ); diff --git a/lib/common/widgets/video_card_h.dart b/lib/common/widgets/video_card_h.dart index cc3e571c8..58b7c5614 100644 --- a/lib/common/widgets/video_card_h.dart +++ b/lib/common/widgets/video_card_h.dart @@ -151,7 +151,8 @@ class VideoCardH extends StatelessWidget { }, ), ), - videoContent(context) + const SizedBox(width: 10), + videoContent(context), ], ), ), @@ -176,107 +177,102 @@ class VideoCardH extends StatelessWidget { : ''; if (pubdate != '') pubdate += ' '; return Expanded( - child: Padding( - padding: const EdgeInsets.fromLTRB(10, 0, 6, 0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (videoItem.title is String) - Expanded( - child: Text( - videoItem.title as String, - textAlign: TextAlign.start, - style: TextStyle( - fontSize: Theme.of(context).textTheme.bodyMedium!.fontSize, - height: 1.42, - letterSpacing: 0.3, - ), - maxLines: 2, - overflow: TextOverflow.ellipsis, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (videoItem.title is String) + Expanded( + child: Text( + videoItem.title, + textAlign: TextAlign.start, + style: TextStyle( + fontSize: Theme.of(context).textTheme.bodyMedium!.fontSize, + height: 1.42, + letterSpacing: 0.3, ), - ) - else - Expanded( - child: RichText( - overflow: TextOverflow.ellipsis, - maxLines: 2, - textScaler: MediaQuery.textScalerOf(context), - text: TextSpan( - children: [ - for (final i in videoItem.title) ...[ - TextSpan( - text: i['text'] as String, - style: TextStyle( - fontSize: Theme.of(context) - .textTheme - .bodyMedium! - .fontSize, - letterSpacing: 0.3, - color: i['type'] == 'em' - ? Theme.of(context).colorScheme.primary - : Theme.of(context).colorScheme.onSurface, - ), + maxLines: 2, + overflow: TextOverflow.ellipsis, + ), + ) + else + Expanded( + child: Text.rich( + overflow: TextOverflow.ellipsis, + maxLines: 2, + TextSpan( + children: [ + for (final i in videoItem.title) ...[ + TextSpan( + text: i['text'] as String, + style: TextStyle( + fontSize: + Theme.of(context).textTheme.bodyMedium!.fontSize, + height: 1.42, + letterSpacing: 0.3, + color: i['type'] == 'em' + ? Theme.of(context).colorScheme.primary + : Theme.of(context).colorScheme.onSurface, ), - ] - ], - ), + ), + ] + ], ), ), - // const Spacer(), - // if (videoItem.rcmdReason != null && - // videoItem.rcmdReason.content != '') - // Container( - // padding: const EdgeInsets.symmetric(vertical: 2, horizontal: 5), - // decoration: BoxDecoration( - // borderRadius: BorderRadius.circular(4), - // border: Border.all( - // color: Theme.of(context).colorScheme.surfaceTint), - // ), - // child: Text( - // videoItem.rcmdReason.content, - // style: TextStyle( - // fontSize: 9, - // color: Theme.of(context).colorScheme.surfaceTint), - // ), - // ), - // const SizedBox(height: 4), - if (showOwner || showPubdate) - Expanded( - flex: 0, - child: Text( - "$pubdate ${showOwner ? videoItem.owner.name : ''}", - maxLines: 1, - style: TextStyle( - fontSize: Theme.of(context).textTheme.labelSmall!.fontSize, - height: 1, - color: Theme.of(context).colorScheme.outline, - overflow: TextOverflow.clip, - ), - ), - ), - const SizedBox(height: 3), - Row( - children: [ - if (showView) ...[ - statView( - context: context, - theme: 'gray', - view: videoItem.stat.view as int, - ), - const SizedBox(width: 8), - ], - if (showDanmaku) - statDanMu( - context: context, - theme: 'gray', - danmu: videoItem.stat.danmu as int, - ), - const Spacer(), - if (source == 'normal') const SizedBox(width: 24), - ], ), - ], - ), + // const Spacer(), + // if (videoItem.rcmdReason != null && + // videoItem.rcmdReason.content != '') + // Container( + // padding: const EdgeInsets.symmetric(vertical: 2, horizontal: 5), + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(4), + // border: Border.all( + // color: Theme.of(context).colorScheme.surfaceTint), + // ), + // child: Text( + // videoItem.rcmdReason.content, + // style: TextStyle( + // fontSize: 9, + // color: Theme.of(context).colorScheme.surfaceTint), + // ), + // ), + // const SizedBox(height: 4), + if (showOwner || showPubdate) + Expanded( + flex: 0, + child: Text( + "$pubdate ${showOwner ? videoItem.owner.name : ''}", + maxLines: 1, + style: TextStyle( + fontSize: Theme.of(context).textTheme.labelSmall!.fontSize, + height: 1, + color: Theme.of(context).colorScheme.outline, + overflow: TextOverflow.clip, + ), + ), + ), + const SizedBox(height: 3), + Row( + children: [ + if (showView) ...[ + statView( + context: context, + theme: 'gray', + view: videoItem.stat.view as int, + ), + const SizedBox(width: 8), + ], + if (showDanmaku) + statDanMu( + context: context, + theme: 'gray', + danmu: videoItem.stat.danmu as int, + ), + const Spacer(), + if (source == 'normal') const SizedBox(width: 24), + ], + ), + ], ), ); } diff --git a/lib/common/widgets/video_card_h_grpc.dart b/lib/common/widgets/video_card_h_grpc.dart index bfb46534c..94221b036 100644 --- a/lib/common/widgets/video_card_h_grpc.dart +++ b/lib/common/widgets/video_card_h_grpc.dart @@ -111,7 +111,8 @@ class VideoCardHGrpc extends StatelessWidget { }, ), ), - videoContent(context) + const SizedBox(width: 10), + videoContent(context), ], ); }, @@ -133,58 +134,43 @@ class VideoCardHGrpc extends StatelessWidget { Widget videoContent(context) { return Expanded( - child: Padding( - padding: const EdgeInsets.fromLTRB(10, 0, 6, 0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ...[ - Expanded( - child: Text( - videoItem.smallCoverV5.base.title, - textAlign: TextAlign.start, - style: TextStyle( - fontSize: Theme.of(context).textTheme.bodyMedium!.fontSize, - height: 1.42, - letterSpacing: 0.3, - ), - maxLines: 2, - overflow: TextOverflow.ellipsis, - ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Text( + videoItem.smallCoverV5.base.title, + textAlign: TextAlign.start, + style: TextStyle( + fontSize: Theme.of(context).textTheme.bodyMedium!.fontSize, + height: 1.42, + letterSpacing: 0.3, ), - ], - // const Spacer(), - // if (videoItem.rcmdReason != null && - // videoItem.rcmdReason.content != '') - // Container( - // padding: const EdgeInsets.symmetric(vertical: 2, horizontal: 5), - // decoration: BoxDecoration( - // borderRadius: BorderRadius.circular(4), - // border: Border.all( - // color: Theme.of(context).colorScheme.surfaceTint), - // ), - // child: Text( - // videoItem.rcmdReason.content, - // style: TextStyle( - // fontSize: 9, - // color: Theme.of(context).colorScheme.surfaceTint), - // ), - // ), - // const SizedBox(height: 4), - if (showOwner || showPubdate) - Text( - videoItem.smallCoverV5.rightDesc1, - maxLines: 1, - style: TextStyle( - fontSize: Theme.of(context).textTheme.labelMedium!.fontSize, - height: 1, - color: Theme.of(context).colorScheme.outline, - overflow: TextOverflow.clip, - ), - ), - const SizedBox(height: 3), + maxLines: 2, + overflow: TextOverflow.ellipsis, + ), + ), + // const Spacer(), + // if (videoItem.rcmdReason != null && + // videoItem.rcmdReason.content != '') + // Container( + // padding: const EdgeInsets.symmetric(vertical: 2, horizontal: 5), + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(4), + // border: Border.all( + // color: Theme.of(context).colorScheme.surfaceTint), + // ), + // child: Text( + // videoItem.rcmdReason.content, + // style: TextStyle( + // fontSize: 9, + // color: Theme.of(context).colorScheme.surfaceTint), + // ), + // ), + // const SizedBox(height: 4), + if (showOwner || showPubdate) Text( - videoItem.smallCoverV5.rightDesc2, + videoItem.smallCoverV5.rightDesc1, maxLines: 1, style: TextStyle( fontSize: Theme.of(context).textTheme.labelMedium!.fontSize, @@ -193,26 +179,36 @@ class VideoCardHGrpc extends StatelessWidget { overflow: TextOverflow.clip, ), ), - // Row( - // children: [ - // if (showView) ...[ - // StatView( - // theme: 'gray', - // view: videoItem.stat.view as int, - // ), - // const SizedBox(width: 8), - // ], - // if (showDanmaku) - // StatDanMu( - // theme: 'gray', - // danmu: videoItem.stat.danmu as int, - // ), - // const Spacer(), - // if (source == 'normal') const SizedBox(width: 24), - // ], - // ), - ], - ), + const SizedBox(height: 3), + Text( + videoItem.smallCoverV5.rightDesc2, + maxLines: 1, + style: TextStyle( + fontSize: Theme.of(context).textTheme.labelMedium!.fontSize, + height: 1, + color: Theme.of(context).colorScheme.outline, + overflow: TextOverflow.clip, + ), + ), + // Row( + // children: [ + // if (showView) ...[ + // StatView( + // theme: 'gray', + // view: videoItem.stat.view as int, + // ), + // const SizedBox(width: 8), + // ], + // if (showDanmaku) + // StatDanMu( + // theme: 'gray', + // danmu: videoItem.stat.danmu as int, + // ), + // const Spacer(), + // if (source == 'normal') const SizedBox(width: 24), + // ], + // ), + ], ), ); } diff --git a/lib/common/widgets/video_card_h_member_video.dart b/lib/common/widgets/video_card_h_member_video.dart index 9b0b12fc5..7b0d0744a 100644 --- a/lib/common/widgets/video_card_h_member_video.dart +++ b/lib/common/widgets/video_card_h_member_video.dart @@ -103,7 +103,8 @@ class VideoCardHMemberVideo extends StatelessWidget { }, ), ), - videoContent(context) + const SizedBox(width: 10), + videoContent(context), ], ); }, @@ -125,66 +126,61 @@ class VideoCardHMemberVideo extends StatelessWidget { Widget videoContent(context) { return Expanded( - child: Padding( - padding: const EdgeInsets.fromLTRB(10, 0, 6, 0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ...[ - Expanded( - child: Text( - // videoItem.season?['title'] ?? videoItem.title ?? '', - videoItem.title ?? '', - textAlign: TextAlign.start, - style: TextStyle( - fontWeight: videoItem.bvid != null && videoItem.bvid == bvid - ? FontWeight.bold - : null, - fontSize: Theme.of(context).textTheme.bodyMedium!.fontSize, - height: 1.42, - letterSpacing: 0.3, - color: videoItem.bvid != null && videoItem.bvid == bvid - ? Theme.of(context).colorScheme.primary - : null, - ), - maxLines: 2, - overflow: TextOverflow.ellipsis, - ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Text( + // videoItem.season?['title'] ?? videoItem.title ?? '', + videoItem.title ?? '', + textAlign: TextAlign.start, + style: TextStyle( + fontWeight: videoItem.bvid != null && videoItem.bvid == bvid + ? FontWeight.bold + : null, + fontSize: Theme.of(context).textTheme.bodyMedium!.fontSize, + height: 1.42, + letterSpacing: 0.3, + color: videoItem.bvid != null && videoItem.bvid == bvid + ? Theme.of(context).colorScheme.primary + : null, + ), + maxLines: 2, + overflow: TextOverflow.ellipsis, + ), + ), + Text( + videoItem.season != null + ? Utils.dateFormat(videoItem.season?['mtime']) + : videoItem.publishTimeText ?? '', + maxLines: 1, + style: TextStyle( + fontSize: Theme.of(context).textTheme.labelMedium!.fontSize, + height: 1, + color: Theme.of(context).colorScheme.outline, + overflow: TextOverflow.clip, + ), + ), + const SizedBox(height: 3), + Row( + children: [ + statView( + context: context, + theme: 'gray', + // view: videoItem.season?['view_content'] ?? + // videoItem.viewContent, + view: videoItem.viewContent, + ), + const SizedBox(width: 8), + statDanMu( + context: context, + theme: 'gray', + // danmu: videoItem.season?['danmaku'] ?? videoItem.danmaku, + danmu: videoItem.danmaku, ), ], - Text( - videoItem.season != null - ? Utils.dateFormat(videoItem.season?['mtime']) - : videoItem.publishTimeText ?? '', - maxLines: 1, - style: TextStyle( - fontSize: Theme.of(context).textTheme.labelMedium!.fontSize, - height: 1, - color: Theme.of(context).colorScheme.outline, - overflow: TextOverflow.clip, - ), - ), - const SizedBox(height: 3), - Row( - children: [ - statView( - context: context, - theme: 'gray', - // view: videoItem.season?['view_content'] ?? - // videoItem.viewContent, - view: videoItem.viewContent, - ), - const SizedBox(width: 8), - statDanMu( - context: context, - theme: 'gray', - // danmu: videoItem.season?['danmaku'] ?? videoItem.danmaku, - danmu: videoItem.danmaku, - ), - ], - ), - ], - ), + ), + ], ), ); } diff --git a/lib/common/widgets/video_card_v.dart b/lib/common/widgets/video_card_v.dart index 4f4641a8d..4ed360655 100644 --- a/lib/common/widgets/video_card_v.dart +++ b/lib/common/widgets/video_card_v.dart @@ -314,10 +314,9 @@ class VideoCardV extends StatelessWidget { const Spacer(), Expanded( flex: 0, - child: RichText( + child: Text.rich( maxLines: 1, - textScaler: MediaQuery.textScalerOf(context), - text: TextSpan( + TextSpan( style: TextStyle( fontSize: Theme.of(context).textTheme.labelSmall!.fontSize, @@ -337,10 +336,9 @@ class VideoCardV extends StatelessWidget { const Spacer(), Expanded( flex: 0, - child: RichText( + child: Text.rich( maxLines: 1, - textScaler: MediaQuery.textScalerOf(context), - text: TextSpan( + TextSpan( style: TextStyle( fontSize: Theme.of(context).textTheme.labelSmall!.fontSize, diff --git a/lib/pages/fav/widgets/item.dart b/lib/pages/fav/widgets/item.dart index afcf3e08d..445fdb4f1 100644 --- a/lib/pages/fav/widgets/item.dart +++ b/lib/pages/fav/widgets/item.dart @@ -53,7 +53,8 @@ class FavItem extends StatelessWidget { }, ), ), - videoContent(context) + const SizedBox(width: 10), + videoContent(context), ], ), ); @@ -65,43 +66,40 @@ class FavItem extends StatelessWidget { Widget videoContent(context) { return Expanded( - child: Padding( - padding: const EdgeInsets.fromLTRB(10, 2, 6, 0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - favFolderItem.title ?? '', - textAlign: TextAlign.start, - style: const TextStyle( - letterSpacing: 0.3, - ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + favFolderItem.title ?? '', + textAlign: TextAlign.start, + style: const TextStyle( + letterSpacing: 0.3, ), - if (favFolderItem.intro?.isNotEmpty == true) - Text( - favFolderItem.intro!, - style: TextStyle( - fontSize: Theme.of(context).textTheme.labelMedium!.fontSize, - color: Theme.of(context).colorScheme.outline, - ), - ), + ), + if (favFolderItem.intro?.isNotEmpty == true) Text( - '${favFolderItem.mediaCount}个内容', + favFolderItem.intro!, style: TextStyle( fontSize: Theme.of(context).textTheme.labelMedium!.fontSize, color: Theme.of(context).colorScheme.outline, ), ), - const Spacer(), - Text( - Utils.isPublicText(favFolderItem.attr ?? 0), - style: TextStyle( - fontSize: Theme.of(context).textTheme.labelMedium!.fontSize, - color: Theme.of(context).colorScheme.outline, - ), + Text( + '${favFolderItem.mediaCount}个内容', + style: TextStyle( + fontSize: Theme.of(context).textTheme.labelMedium!.fontSize, + color: Theme.of(context).colorScheme.outline, ), - ], - ), + ), + const Spacer(), + Text( + Utils.isPublicText(favFolderItem.attr ?? 0), + style: TextStyle( + fontSize: Theme.of(context).textTheme.labelMedium!.fontSize, + color: Theme.of(context).colorScheme.outline, + ), + ), + ], ), ); } diff --git a/lib/pages/fav_detail/view.dart b/lib/pages/fav_detail/view.dart index 587352c76..9b9cf32b8 100644 --- a/lib/pages/fav_detail/view.dart +++ b/lib/pages/fav_detail/view.dart @@ -61,6 +61,7 @@ class _FavDetailPageState extends State { } }, child: Scaffold( + resizeToAvoidBottomInset: false, floatingActionButton: Obx( () => (_favDetailController.item.value.mediaCount ?? -1) > 0 ? FloatingActionButton.extended( diff --git a/lib/pages/fav_detail/widget/fav_video_card.dart b/lib/pages/fav_detail/widget/fav_video_card.dart index 53fbb758a..7989f1a11 100644 --- a/lib/pages/fav_detail/widget/fav_video_card.dart +++ b/lib/pages/fav_detail/widget/fav_video_card.dart @@ -137,7 +137,8 @@ class FavVideoCardH extends StatelessWidget { }, ), ), - videoContent(context) + const SizedBox(width: 10), + videoContent(context), ], ), ); @@ -149,113 +150,106 @@ class FavVideoCardH extends StatelessWidget { Widget videoContent(context) { return Expanded( - child: Padding( - padding: const EdgeInsets.fromLTRB(10, 2, 6, 0), - child: Stack( - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - videoItem.title, - textAlign: TextAlign.start, - style: const TextStyle( - letterSpacing: 0.3, - ), - maxLines: 2, - overflow: TextOverflow.ellipsis, + child: Stack( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + videoItem.title, + textAlign: TextAlign.start, + style: const TextStyle( + letterSpacing: 0.3, ), - if (videoItem.ogv != null) ...[ - Text( - videoItem.intro, - style: TextStyle( - fontSize: - Theme.of(context).textTheme.labelMedium!.fontSize, - color: Theme.of(context).colorScheme.outline, - ), - ), - ], - const Spacer(), + maxLines: 2, + overflow: TextOverflow.ellipsis, + ), + if (videoItem.ogv != null) ...[ Text( - Utils.dateFormat(videoItem.favTime), + videoItem.intro, style: TextStyle( - fontSize: 11, - color: Theme.of(context).colorScheme.outline), - ), - if (videoItem.owner.name != '') ...[ - Text( - videoItem.owner.name, - style: TextStyle( - fontSize: - Theme.of(context).textTheme.labelMedium!.fontSize, - color: Theme.of(context).colorScheme.outline, - ), - ), - ], - Padding( - padding: const EdgeInsets.only(top: 2), - child: Row( - children: [ - statView( - context: context, - theme: 'gray', - view: videoItem.cntInfo['play'], - ), - const SizedBox(width: 8), - statDanMu( - context: context, - theme: 'gray', - danmu: videoItem.cntInfo['danmaku'], - ), - const Spacer(), - ], + fontSize: Theme.of(context).textTheme.labelMedium!.fontSize, + color: Theme.of(context).colorScheme.outline, ), ), ], - ), - if (searchType != 1 && isOwner) - Positioned( - right: 0, - bottom: 0, - child: iconButton( - context: context, - icon: Icons.clear, - tooltip: '取消收藏', - iconColor: Theme.of(context).colorScheme.onSurfaceVariant, - bgColor: Colors.transparent, - onPressed: () { - showDialog( - context: Get.context!, - builder: (context) { - return AlertDialog( - title: const Text('提示'), - content: const Text('要取消收藏吗?'), - actions: [ - TextButton( - onPressed: Get.back, - child: Text( - '取消', - style: TextStyle( - color: - Theme.of(context).colorScheme.outline), - ), - ), - TextButton( - onPressed: () async { - await callFn?.call(); - Get.back(); - }, - child: const Text('确定取消'), - ) - ], - ); - }, - ); - }, + const Spacer(), + Text( + Utils.dateFormat(videoItem.favTime), + style: TextStyle( + fontSize: 11, color: Theme.of(context).colorScheme.outline), + ), + if (videoItem.owner.name != '') ...[ + Text( + videoItem.owner.name, + style: TextStyle( + fontSize: Theme.of(context).textTheme.labelMedium!.fontSize, + color: Theme.of(context).colorScheme.outline, + ), + ), + ], + Padding( + padding: const EdgeInsets.only(top: 2), + child: Row( + children: [ + statView( + context: context, + theme: 'gray', + view: videoItem.cntInfo['play'], + ), + const SizedBox(width: 8), + statDanMu( + context: context, + theme: 'gray', + danmu: videoItem.cntInfo['danmaku'], + ), + const Spacer(), + ], ), ), - ], - ), + ], + ), + if (searchType != 1 && isOwner) + Positioned( + right: 0, + bottom: 0, + child: iconButton( + context: context, + icon: Icons.clear, + tooltip: '取消收藏', + iconColor: Theme.of(context).colorScheme.onSurfaceVariant, + bgColor: Colors.transparent, + onPressed: () { + showDialog( + context: Get.context!, + builder: (context) { + return AlertDialog( + title: const Text('提示'), + content: const Text('要取消收藏吗?'), + actions: [ + TextButton( + onPressed: Get.back, + child: Text( + '取消', + style: TextStyle( + color: Theme.of(context).colorScheme.outline), + ), + ), + TextButton( + onPressed: () async { + await callFn?.call(); + Get.back(); + }, + child: const Text('确定取消'), + ) + ], + ); + }, + ); + }, + ), + ), + ], ), ); } diff --git a/lib/pages/history/widgets/item.dart b/lib/pages/history/widgets/item.dart index 7e831511f..a3110b396 100644 --- a/lib/pages/history/widgets/item.dart +++ b/lib/pages/history/widgets/item.dart @@ -291,7 +291,8 @@ class HistoryItem extends StatelessWidget { ), ], ), - videoContent(context) + const SizedBox(width: 10), + videoContent(context), ], ), ); @@ -303,113 +304,108 @@ class HistoryItem extends StatelessWidget { Widget videoContent(context) { return Expanded( - child: Padding( - padding: const EdgeInsets.fromLTRB(10, 2, 6, 0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + videoItem.title, + textAlign: TextAlign.start, + style: const TextStyle( + letterSpacing: 0.3, + ), + maxLines: videoItem.videos > 1 ? 1 : 2, + overflow: TextOverflow.ellipsis, + ), + if (videoItem.isFullScreen != null) ...[ + const SizedBox(height: 2), Text( - videoItem.title, + videoItem.isFullScreen, textAlign: TextAlign.start, - style: const TextStyle( - letterSpacing: 0.3, - ), - maxLines: videoItem.videos > 1 ? 1 : 2, + style: TextStyle( + fontSize: Theme.of(context).textTheme.labelMedium!.fontSize, + color: Theme.of(context).colorScheme.outline), + maxLines: 1, overflow: TextOverflow.ellipsis, ), - if (videoItem.isFullScreen != null) ...[ - const SizedBox(height: 2), - Text( - videoItem.isFullScreen, - textAlign: TextAlign.start, - style: TextStyle( - fontSize: Theme.of(context).textTheme.labelMedium!.fontSize, - color: Theme.of(context).colorScheme.outline), - maxLines: 1, - overflow: TextOverflow.ellipsis, - ), - ], - const Spacer(), - if (videoItem.authorName != '') - Row( - children: [ - Text( - videoItem.authorName, - style: TextStyle( - fontSize: - Theme.of(context).textTheme.labelMedium!.fontSize, - color: Theme.of(context).colorScheme.outline, - ), - ), - ], - ), + ], + const Spacer(), + if (videoItem.authorName != '') Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( - Utils.dateFormat(videoItem.viewAt!), + videoItem.authorName, style: TextStyle( - fontSize: - Theme.of(context).textTheme.labelMedium!.fontSize, - color: Theme.of(context).colorScheme.outline), - ), - SizedBox( - width: 24, - height: 24, - child: PopupMenuButton( - padding: EdgeInsets.zero, - tooltip: '功能菜单', - icon: Icon( - Icons.more_vert_outlined, - color: Theme.of(context).colorScheme.outline, - size: 18, - ), - position: PopupMenuPosition.under, - // constraints: const BoxConstraints(maxHeight: 35), - onSelected: (String type) {}, - itemBuilder: (BuildContext context) => - >[ - if (videoItem.history?.business != 'pgc' && - videoItem.badge != '番剧' && - !videoItem.tagName.contains('动画') && - videoItem.history.business != 'live' && - !videoItem.history.business.contains('article')) - PopupMenuItem( - onTap: () async { - var res = await UserHttp.toViewLater( - bvid: videoItem.history.bvid); - SmartDialog.showToast(res['msg']); - }, - value: 'pause', - height: 35, - child: const Row( - children: [ - Icon(Icons.watch_later_outlined, size: 16), - SizedBox(width: 6), - Text('稍后再看', style: TextStyle(fontSize: 13)) - ], - ), - ), - PopupMenuItem( - onTap: () => ctr!.delHistory( - videoItem.kid, videoItem.history.business), - value: 'pause', - height: 35, - child: const Row( - children: [ - Icon(Icons.close_outlined, size: 16), - SizedBox(width: 6), - Text('删除记录', style: TextStyle(fontSize: 13)) - ], - ), - ), - ], + fontSize: Theme.of(context).textTheme.labelMedium!.fontSize, + color: Theme.of(context).colorScheme.outline, ), ), ], ), - ], - ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + Utils.dateFormat(videoItem.viewAt!), + style: TextStyle( + fontSize: Theme.of(context).textTheme.labelMedium!.fontSize, + color: Theme.of(context).colorScheme.outline), + ), + SizedBox( + width: 24, + height: 24, + child: PopupMenuButton( + padding: EdgeInsets.zero, + tooltip: '功能菜单', + icon: Icon( + Icons.more_vert_outlined, + color: Theme.of(context).colorScheme.outline, + size: 18, + ), + position: PopupMenuPosition.under, + // constraints: const BoxConstraints(maxHeight: 35), + onSelected: (String type) {}, + itemBuilder: (BuildContext context) => + >[ + if (videoItem.history?.business != 'pgc' && + videoItem.badge != '番剧' && + !videoItem.tagName.contains('动画') && + videoItem.history.business != 'live' && + !videoItem.history.business.contains('article')) + PopupMenuItem( + onTap: () async { + var res = await UserHttp.toViewLater( + bvid: videoItem.history.bvid); + SmartDialog.showToast(res['msg']); + }, + value: 'pause', + height: 35, + child: const Row( + children: [ + Icon(Icons.watch_later_outlined, size: 16), + SizedBox(width: 6), + Text('稍后再看', style: TextStyle(fontSize: 13)) + ], + ), + ), + PopupMenuItem( + onTap: () => ctr!.delHistory( + videoItem.kid, videoItem.history.business), + value: 'pause', + height: 35, + child: const Row( + children: [ + Icon(Icons.close_outlined, size: 16), + SizedBox(width: 6), + Text('删除记录', style: TextStyle(fontSize: 13)) + ], + ), + ), + ], + ), + ), + ], + ), + ], ), ); } diff --git a/lib/pages/later/view.dart b/lib/pages/later/view.dart index 15c71de53..49325cb5c 100644 --- a/lib/pages/later/view.dart +++ b/lib/pages/later/view.dart @@ -34,6 +34,7 @@ class _LaterPageState extends State { } }, child: Scaffold( + resizeToAvoidBottomInset: false, appBar: AppBarWidget( visible: _laterController.enableMultiSelect.value, child1: AppBar( diff --git a/lib/pages/member/new/content/member_contribute/content/season_series/widget/season_series_card.dart b/lib/pages/member/new/content/member_contribute/content/season_series/widget/season_series_card.dart index 7cb7243f2..3e71fcf82 100644 --- a/lib/pages/member/new/content/member_contribute/content/season_series/widget/season_series_card.dart +++ b/lib/pages/member/new/content/member_contribute/content/season_series/widget/season_series_card.dart @@ -58,7 +58,8 @@ class SeasonSeriesCard extends StatelessWidget { }, ), ), - videoContent(context) + const SizedBox(width: 10), + videoContent(context), ], ), ), @@ -67,36 +68,33 @@ class SeasonSeriesCard extends StatelessWidget { Widget videoContent(context) { return Expanded( - child: Padding( - padding: const EdgeInsets.fromLTRB(10, 0, 6, 0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - item['meta']['name'], - textAlign: TextAlign.start, - style: TextStyle( - fontSize: Theme.of(context).textTheme.bodyMedium!.fontSize, - height: 1.42, - letterSpacing: 0.3, - ), - maxLines: 2, - overflow: TextOverflow.ellipsis, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + item['meta']['name'], + textAlign: TextAlign.start, + style: TextStyle( + fontSize: Theme.of(context).textTheme.bodyMedium!.fontSize, + height: 1.42, + letterSpacing: 0.3, ), - const Spacer(), - Text( - Utils.dateFormat(item['meta']['ptime']), - maxLines: 1, - style: TextStyle( - fontSize: Theme.of(context).textTheme.labelSmall!.fontSize, - height: 1, - color: Theme.of(context).colorScheme.outline, - overflow: TextOverflow.clip, - ), + maxLines: 2, + overflow: TextOverflow.ellipsis, + ), + const Spacer(), + Text( + Utils.dateFormat(item['meta']['ptime']), + maxLines: 1, + style: TextStyle( + fontSize: Theme.of(context).textTheme.labelSmall!.fontSize, + height: 1, + color: Theme.of(context).colorScheme.outline, + overflow: TextOverflow.clip, ), - const Spacer(), - ], - ), + ), + const Spacer(), + ], ), ); } diff --git a/lib/pages/search_panel/view.dart b/lib/pages/search_panel/view.dart index f94a862e5..03153662a 100644 --- a/lib/pages/search_panel/view.dart +++ b/lib/pages/search_panel/view.dart @@ -69,7 +69,11 @@ class _SearchPanelState extends State SliverGrid( gridDelegate: SliverGridDelegateWithExtentAndRatio( mainAxisSpacing: 2, - maxCrossAxisExtent: Grid.smallCardWidth * 2, + maxCrossAxisExtent: (widget.searchType == SearchType.video || + widget.searchType == SearchType.article + ? Grid.mediumCardWidth + : Grid.smallCardWidth) * + 2, childAspectRatio: StyleString.aspectRatio * (widget.searchType == SearchType.media_bangumi || widget.searchType == SearchType.media_ft diff --git a/lib/pages/search_panel/widgets/article_panel.dart b/lib/pages/search_panel/widgets/article_panel.dart index 7311d1d21..704c01d5a 100644 --- a/lib/pages/search_panel/widgets/article_panel.dart +++ b/lib/pages/search_panel/widgets/article_panel.dart @@ -153,61 +153,54 @@ Widget searchArticlePanel(context, searchPanelCtr, LoadingState loadingState) { ); }), ), + const SizedBox(width: 10), Expanded( - child: Padding( - padding: const EdgeInsets.fromLTRB( - 10, 2, 6, 0), - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - RichText( - maxLines: 2, - textScaler: - MediaQuery.textScalerOf( - context), - text: TextSpan( - children: [ - for (var i in loadingState - .response[index] - .title) ...[ - TextSpan( - text: i['text'], - style: TextStyle( - color: i['type'] == 'em' - ? Theme.of(context) - .colorScheme - .primary - : Theme.of(context) - .colorScheme - .onSurface, - ), - ), - ] - ], - ), - ), - const Spacer(), - Text( - Utils.dateFormat( - loadingState.response[index] - .pubTime, - formatType: 'detail'), - style: textStyle), - Row( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text.rich( + maxLines: 2, + TextSpan( children: [ - Text( - '${loadingState.response[index].view}浏览', - style: textStyle), - Text(' • ', style: textStyle), - Text( - '${loadingState.response[index].reply}评论', - style: textStyle), + for (var i in loadingState + .response[index].title) ...[ + TextSpan( + text: i['text'], + style: TextStyle( + color: i['type'] == 'em' + ? Theme.of(context) + .colorScheme + .primary + : Theme.of(context) + .colorScheme + .onSurface, + ), + ), + ] ], ), - ], - ), + ), + const Spacer(), + Text( + Utils.dateFormat( + loadingState + .response[index].pubTime, + formatType: 'detail'), + style: textStyle), + Row( + children: [ + Text( + '${loadingState.response[index].view}浏览', + style: textStyle), + Text(' • ', style: textStyle), + Text( + '${loadingState.response[index].reply}评论', + style: textStyle), + ], + ), + ], ), ), ], diff --git a/lib/pages/search_panel/widgets/live_panel.dart b/lib/pages/search_panel/widgets/live_panel.dart index 67295e6d6..7396ea693 100644 --- a/lib/pages/search_panel/widgets/live_panel.dart +++ b/lib/pages/search_panel/widgets/live_panel.dart @@ -127,9 +127,8 @@ class LiveContent extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - RichText( - textScaler: MediaQuery.textScalerOf(context), - text: TextSpan( + Text.rich( + TextSpan( children: [ for (var i in liveItem.title) ...[ TextSpan( diff --git a/lib/pages/search_panel/widgets/media_bangumi_panel.dart b/lib/pages/search_panel/widgets/media_bangumi_panel.dart index 5b41da9be..4d7fefb9a 100644 --- a/lib/pages/search_panel/widgets/media_bangumi_panel.dart +++ b/lib/pages/search_panel/widgets/media_bangumi_panel.dart @@ -75,12 +75,10 @@ Widget searchBangumiPanel(context, ctr, LoadingState loadingState) { crossAxisAlignment: CrossAxisAlignment.start, children: [ const SizedBox(height: 4), - RichText( + Text.rich( // maxLines: 1, // overflow: TextOverflow.ellipsis, - textScaler: - MediaQuery.textScalerOf(context), - text: TextSpan( + TextSpan( style: TextStyle( color: Theme.of(context) .colorScheme diff --git a/lib/pages/subscription/widgets/item.dart b/lib/pages/subscription/widgets/item.dart index dab28717f..bbe69d889 100644 --- a/lib/pages/subscription/widgets/item.dart +++ b/lib/pages/subscription/widgets/item.dart @@ -62,7 +62,8 @@ class SubItem extends StatelessWidget { }, ), ), - videoContent(context) + const SizedBox(width: 10), + videoContent(context), ], ), ); @@ -84,39 +85,36 @@ class SubItem extends StatelessWidget { return Expanded( child: Stack( children: [ - Padding( - padding: const EdgeInsets.fromLTRB(10, 2, 6, 0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - subFolderItem.title!, - textAlign: TextAlign.start, - style: const TextStyle( - letterSpacing: 0.3, - ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + subFolderItem.title!, + textAlign: TextAlign.start, + style: const TextStyle( + letterSpacing: 0.3, ), - const SizedBox(height: 2), - Text( - '[$typeString] UP主:${subFolderItem.upper!.name!}', - textAlign: TextAlign.start, - style: TextStyle( - fontSize: Theme.of(context).textTheme.labelMedium!.fontSize, - color: Theme.of(context).colorScheme.outline, - ), + ), + const SizedBox(height: 2), + Text( + '[$typeString] UP主:${subFolderItem.upper!.name!}', + textAlign: TextAlign.start, + style: TextStyle( + fontSize: Theme.of(context).textTheme.labelMedium!.fontSize, + color: Theme.of(context).colorScheme.outline, ), - const SizedBox(height: 2), - Text( - '${subFolderItem.mediaCount}个视频', - textAlign: TextAlign.start, - style: TextStyle( - fontSize: Theme.of(context).textTheme.labelMedium!.fontSize, - color: Theme.of(context).colorScheme.outline, - ), + ), + const SizedBox(height: 2), + Text( + '${subFolderItem.mediaCount}个视频', + textAlign: TextAlign.start, + style: TextStyle( + fontSize: Theme.of(context).textTheme.labelMedium!.fontSize, + color: Theme.of(context).colorScheme.outline, ), - const Spacer(), - ], - ), + ), + const Spacer(), + ], ), Positioned( bottom: 0, diff --git a/lib/pages/subscription_detail/widget/sub_video_card.dart b/lib/pages/subscription_detail/widget/sub_video_card.dart index bc54a5f1a..91b67fe54 100644 --- a/lib/pages/subscription_detail/widget/sub_video_card.dart +++ b/lib/pages/subscription_detail/widget/sub_video_card.dart @@ -97,7 +97,8 @@ class SubVideoCardH extends StatelessWidget { }, ), ), - videoContent(context) + const SizedBox(width: 10), + videoContent(context), ], ), ); @@ -109,52 +110,48 @@ class SubVideoCardH extends StatelessWidget { Widget videoContent(context) { return Expanded( - child: Padding( - padding: const EdgeInsets.fromLTRB(10, 2, 6, 0), - child: Stack( - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - '${videoItem.title}', - textAlign: TextAlign.start, - style: const TextStyle( - letterSpacing: 0.3, - ), - maxLines: 2, - overflow: TextOverflow.ellipsis, + child: Stack( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + '${videoItem.title}', + textAlign: TextAlign.start, + style: const TextStyle( + letterSpacing: 0.3, ), - const Spacer(), - Text( - Utils.dateFormat(videoItem.pubtime), - style: TextStyle( - fontSize: 11, - color: Theme.of(context).colorScheme.outline), + maxLines: 2, + overflow: TextOverflow.ellipsis, + ), + const Spacer(), + Text( + Utils.dateFormat(videoItem.pubtime), + style: TextStyle( + fontSize: 11, color: Theme.of(context).colorScheme.outline), + ), + Padding( + padding: const EdgeInsets.only(top: 2), + child: Row( + children: [ + statView( + context: context, + theme: 'gray', + view: videoItem.cntInfo?['play'], + ), + const SizedBox(width: 8), + statDanMu( + context: context, + theme: 'gray', + danmu: videoItem.cntInfo?['danmaku'], + ), + const Spacer(), + ], ), - Padding( - padding: const EdgeInsets.only(top: 2), - child: Row( - children: [ - statView( - context: context, - theme: 'gray', - view: videoItem.cntInfo?['play'], - ), - const SizedBox(width: 8), - statDanMu( - context: context, - theme: 'gray', - danmu: videoItem.cntInfo?['danmaku'], - ), - const Spacer(), - ], - ), - ), - ], - ), - ], - ), + ), + ], + ), + ], ), ); } diff --git a/lib/pages/video/detail/widgets/watch_later_list.dart b/lib/pages/video/detail/widgets/watch_later_list.dart index cf174873d..13546a0af 100644 --- a/lib/pages/video/detail/widgets/watch_later_list.dart +++ b/lib/pages/video/detail/widgets/watch_later_list.dart @@ -182,60 +182,56 @@ class _MediaListPanelState extends State { }, ), ), + const SizedBox(width: 10), Expanded( - child: Padding( - padding: const EdgeInsets.fromLTRB(10, 0, 6, 0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - item.title as String, - textAlign: TextAlign.start, - maxLines: 2, - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontWeight: item.bvid == widget.getBvId() - ? FontWeight.bold - : null, - color: item.bvid == widget.getBvId() - ? Theme.of(context) - .colorScheme - .primary - : null, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + item.title as String, + textAlign: TextAlign.start, + maxLines: 2, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontWeight: item.bvid == widget.getBvId() + ? FontWeight.bold + : null, + color: item.bvid == widget.getBvId() + ? Theme.of(context).colorScheme.primary + : null, + ), + ), + const Spacer(), + Text( + item.upper?.name as String, + style: TextStyle( + fontSize: Theme.of(context) + .textTheme + .labelMedium! + .fontSize, + color: + Theme.of(context).colorScheme.outline, + ), + ), + const SizedBox(height: 2), + Row( + children: [ + statView( + context: context, + theme: 'gray', + view: item.cntInfo!['play'] as int, ), - ), - const Spacer(), - Text( - item.upper?.name as String, - style: TextStyle( - fontSize: Theme.of(context) - .textTheme - .labelMedium! - .fontSize, - color: - Theme.of(context).colorScheme.outline, + const SizedBox(width: 8), + statDanMu( + context: context, + theme: 'gray', + danmu: item.cntInfo!['danmaku'] as int, ), - ), - const SizedBox(height: 2), - Row( - children: [ - statView( - context: context, - theme: 'gray', - view: item.cntInfo!['play'] as int, - ), - const SizedBox(width: 8), - statDanMu( - context: context, - theme: 'gray', - danmu: item.cntInfo!['danmaku'] as int, - ), - ], - ), - ], - ), + ], + ), + ], ), - ) + ), ], ), );