From c05fbde3fa194a6ef1488d0967caa73b6cbbc935 Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Fri, 13 Jun 2025 11:49:38 +0800 Subject: [PATCH] opt item Signed-off-by: bggRGjQaUbCoE --- lib/common/skeleton/space_opus.dart | 1 - lib/common/widgets/color_palette.dart | 3 +- .../widgets/image/network_img_layer.dart | 1 + .../widgets/video_card/video_card_h.dart | 248 +++++---- .../widgets/video_card/video_card_v.dart | 84 ++- lib/common/widgets/video_popup_menu.dart | 4 +- lib/pages/article_list/widgets/item.dart | 157 +++--- lib/pages/common/common_slide_page.dart | 4 +- lib/pages/dynamics/view.dart | 8 +- lib/pages/dynamics/widgets/author_panel.dart | 6 +- lib/pages/dynamics/widgets/content_panel.dart | 36 +- lib/pages/dynamics/widgets/dynamic_panel.dart | 3 +- .../dynamics/widgets/live_panel_sub.dart | 1 - .../dynamics/widgets/live_rcmd_panel.dart | 1 - lib/pages/dynamics/widgets/module_panel.dart | 25 +- lib/pages/dynamics/widgets/up_panel.dart | 7 +- lib/pages/dynamics/widgets/video_panel.dart | 15 +- lib/pages/dynamics_create/view.dart | 4 +- lib/pages/dynamics_select_topic/view.dart | 5 +- .../dynamics_select_topic/widgets/item.dart | 53 +- lib/pages/emote/view.dart | 4 +- lib/pages/episode_panel/view.dart | 81 ++- lib/pages/fan/view.dart | 19 +- lib/pages/fav/article/widget/item.dart | 2 +- lib/pages/fav/note/widget/item.dart | 2 +- lib/pages/fav/pgc/widget/item.dart | 2 +- lib/pages/fav/video/widgets/item.dart | 67 +-- .../fav_detail/widget/fav_video_card.dart | 141 ++--- lib/pages/fav_panel/view.dart | 20 +- lib/pages/follow/child/child_view.dart | 33 +- lib/pages/follow/view.dart | 9 +- lib/pages/follow/widgets/follow_item.dart | 156 +++--- lib/pages/group_panel/view.dart | 20 +- lib/pages/history/view.dart | 28 +- lib/pages/history/widgets/item.dart | 459 ++++++++--------- lib/pages/home/view.dart | 49 +- lib/pages/later/view.dart | 4 +- .../later/widgets/video_card_h_later.dart | 2 +- lib/pages/live/view.dart | 3 +- lib/pages/live/widgets/live_item_app.dart | 14 +- lib/pages/live_emote/view.dart | 2 +- .../live_follow/widgets/live_item_follow.dart | 15 +- lib/pages/live_room/widgets/chat.dart | 9 +- lib/pages/live_search/view.dart | 27 +- .../live_search/widgets/live_search_room.dart | 14 +- .../live_search/widgets/live_search_user.dart | 81 +-- lib/pages/main/view.dart | 2 +- lib/pages/media/view.dart | 2 +- lib/pages/media/widgets/item.dart | 5 +- lib/pages/member_article/widget/item.dart | 2 +- lib/pages/member_coin_arc/widgets/item.dart | 2 +- lib/pages/member_contribute/view.dart | 11 +- lib/pages/member_favorite/widget/item.dart | 2 +- lib/pages/member_home/widgets/fav_item.dart | 2 +- .../widgets/video_card_v_member_home.dart | 2 +- .../member_opus/widgets/space_opus_item.dart | 1 - .../widgets/pgc_card_v_member_pgc.dart | 18 +- .../widget/season_series_card.dart | 86 ++-- lib/pages/member_upower_rank/view.dart | 119 +++-- lib/pages/member_video/view.dart | 4 +- .../widgets/video_card_h_member_video.dart | 291 +++++------ lib/pages/mine/controller.dart | 6 +- lib/pages/pgc/view.dart | 148 +++--- lib/pages/pgc/widgets/pgc_card_v.dart | 18 +- .../pgc/widgets/pgc_card_v_timeline.dart | 5 +- .../widgets/pgc_card_v_pgc_index.dart | 5 +- lib/pages/pgc_review/child/view.dart | 463 ++++++++--------- lib/pages/pgc_review/view.dart | 23 +- lib/pages/rank/view.dart | 30 +- lib/pages/rank/zone/widget/pgc_rank_item.dart | 2 +- lib/pages/rcmd/view.dart | 1 - lib/pages/search/widgets/hot_keyword.dart | 4 +- .../all/widgets/pgc_card_v_search.dart | 5 +- .../search_panel/article/controller.dart | 1 - .../search_panel/article/widgets/item.dart | 137 ++--- lib/pages/search_panel/live/widgets/item.dart | 5 +- lib/pages/search_panel/pgc/widgets/item.dart | 153 +++--- lib/pages/search_panel/user/controller.dart | 1 - lib/pages/search_panel/user/widgets/item.dart | 93 ++-- lib/pages/search_panel/video/controller.dart | 1 - lib/pages/search_result/view.dart | 83 ++- lib/pages/setting/pages/logs.dart | 2 - lib/pages/setting/view.dart | 41 +- lib/pages/subscription/widgets/item.dart | 129 ++--- lib/pages/subscription_detail/view.dart | 6 +- .../widget/sub_video_card.dart | 111 ++-- lib/pages/video/introduction/pgc/view.dart | 213 +++----- .../introduction/pgc/widgets/pgc_panel.dart | 2 +- lib/pages/video/introduction/ugc/view.dart | 72 +-- .../introduction/ugc/widgets/action_item.dart | 125 ++--- .../ugc/widgets/action_row_item.dart | 79 --- .../introduction/ugc/widgets/menu_row.dart | 103 +--- .../video/introduction/ugc/widgets/page.dart | 2 +- .../introduction/ugc/widgets/season.dart | 108 ++-- lib/pages/video/medialist/view.dart | 280 +++++----- lib/pages/video/member/view.dart | 66 ++- lib/pages/video/note/view.dart | 153 +++--- .../video/reply/widgets/reply_item_grpc.dart | 2 +- lib/pages/video/view.dart | 143 +++--- lib/pages/video/widgets/header_control.dart | 481 ++++++++---------- lib/pages/whisper_detail/view.dart | 7 +- .../whisper_detail/widget/chat_item.dart | 18 +- .../pl_player/widgets/backward_seek.dart | 65 +-- .../pl_player/widgets/forward_seek.dart | 63 +-- lib/utils/page_utils.dart | 46 +- lib/utils/theme_utils.dart | 1 + 106 files changed, 2780 insertions(+), 3200 deletions(-) delete mode 100644 lib/pages/video/introduction/ugc/widgets/action_row_item.dart diff --git a/lib/common/skeleton/space_opus.dart b/lib/common/skeleton/space_opus.dart index 0ecbcf27..b0706264 100644 --- a/lib/common/skeleton/space_opus.dart +++ b/lib/common/skeleton/space_opus.dart @@ -11,7 +11,6 @@ class SpaceOpusSkeleton extends StatelessWidget { return Skeleton( child: Card( clipBehavior: Clip.hardEdge, - margin: EdgeInsets.zero, shape: const RoundedRectangleBorder( borderRadius: BorderRadius.all(Radius.circular(6)), ), diff --git a/lib/common/widgets/color_palette.dart b/lib/common/widgets/color_palette.dart index 33b0884a..49c3aff3 100644 --- a/lib/common/widgets/color_palette.dart +++ b/lib/common/widgets/color_palette.dart @@ -1,3 +1,4 @@ +import 'package:PiliPlus/common/constants.dart'; import 'package:flutter/material.dart'; import 'package:material_color_utilities/material_color_utilities.dart'; @@ -68,7 +69,7 @@ class ColorPalette extends StatelessWidget { padding: const EdgeInsets.all(6), decoration: BoxDecoration( color: theme.colorScheme.onInverseSurface, - borderRadius: const BorderRadius.all(Radius.circular(10)), + borderRadius: StyleString.mdRadius, ), child: child, ); diff --git a/lib/common/widgets/image/network_img_layer.dart b/lib/common/widgets/image/network_img_layer.dart index c608d239..bb5bda34 100644 --- a/lib/common/widgets/image/network_img_layer.dart +++ b/lib/common/widgets/image/network_img_layer.dart @@ -78,6 +78,7 @@ class NetworkImgLayer extends StatelessWidget { placeholder: (BuildContext context, String url) => getPlaceHolder?.call() ?? placeholder(context), imageBuilder: imageBuilder, + errorWidget: (context, url, error) => placeholder(context), ); } diff --git a/lib/common/widgets/video_card/video_card_h.dart b/lib/common/widgets/video_card/video_card_h.dart index f8d2f553..accdf444 100644 --- a/lib/common/widgets/video_card/video_card_h.dart +++ b/lib/common/widgets/video_card/video_card_h.dart @@ -49,136 +49,132 @@ class VideoCardH extends StatelessWidget { } } return Material( - color: Colors.transparent, + type: MaterialType.transparency, child: Stack( clipBehavior: Clip.none, children: [ - Semantics( - label: Utils.videoItemSemantics(videoItem), - excludeSemantics: true, - child: InkWell( - onLongPress: onLongPress ?? - () => imageSaveDialog( - bvid: videoItem.bvid, - title: videoItem.title, - cover: videoItem.cover, - ), - onTap: onTap ?? - () async { - if (type == 'ketang') { - SmartDialog.showToast('课堂视频暂不支持播放'); - return; - } else if (type == 'live_room') { - if (videoItem case SearchVideoItemModel item) { - int? roomId = item.id; - if (roomId != null) { - Get.toNamed('/liveRoom?roomid=$roomId'); - } - } else { - SmartDialog.showToast( - 'err: live_room : ${videoItem.runtimeType}'); - } - return; - } - if (videoItem case HotVideoItemModel item) { - if (item.redirectUrl?.isNotEmpty == true && - PageUtils.viewPgcFromUri(item.redirectUrl!)) { - return; - } - } - try { - final int? cid = videoItem.cid ?? - await SearchHttp.ab2c( - aid: videoItem.aid, bvid: videoItem.bvid); - if (cid != null) { - PageUtils.toVideoPage( - 'bvid=${videoItem.bvid}&cid=$cid', - arguments: { - 'videoItem': videoItem, - 'heroTag': Utils.makeHeroTag(videoItem.aid) - }, - ); - } - } catch (err) { - SmartDialog.showToast(err.toString()); - } - }, - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: StyleString.safeSpace, - vertical: 5, - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AspectRatio( - aspectRatio: StyleString.aspectRatio, - child: LayoutBuilder( - builder: (context, boxConstraints) { - final double maxWidth = boxConstraints.maxWidth; - final double maxHeight = boxConstraints.maxHeight; - num? progress; - if (videoItem case HotVideoItemModel item) { - progress = item.progress; - } - - return Stack( - clipBehavior: Clip.none, - children: [ - NetworkImgLayer( - src: videoItem.cover, - width: maxWidth, - height: maxHeight, - ), - if (videoItem case HotVideoItemModel item) - PBadge( - text: item.pgcLabel, - top: 6.0, - right: 6.0, - ), - if (progress != null && progress != 0) ...[ - PBadge( - text: progress == -1 - ? '已看完' - : '${Utils.timeFormat(progress)}/${Utils.timeFormat(videoItem.duration)}', - right: 6, - bottom: 8, - type: PBadgeType.gray, - ), - Positioned( - left: 0, - bottom: 0, - right: 0, - child: videoProgressIndicator( - progress == -1 - ? 1 - : progress / videoItem.duration, - ), - ) - ] else if (videoItem.duration > 0) - PBadge( - text: Utils.timeFormat(videoItem.duration), - right: 6.0, - bottom: 6.0, - type: PBadgeType.gray, - ), - if (type != 'video') - PBadge( - text: type, - left: 6.0, - bottom: 6.0, - type: PBadgeType.primary, - ), - ], - ); - }, - ), + InkWell( + onLongPress: onLongPress ?? + () => imageSaveDialog( + bvid: videoItem.bvid, + title: videoItem.title, + cover: videoItem.cover, ), - const SizedBox(width: 10), - content(context), - ], - ), + onTap: onTap ?? + () async { + if (type == 'ketang') { + SmartDialog.showToast('课堂视频暂不支持播放'); + return; + } else if (type == 'live_room') { + if (videoItem case SearchVideoItemModel item) { + int? roomId = item.id; + if (roomId != null) { + Get.toNamed('/liveRoom?roomid=$roomId'); + } + } else { + SmartDialog.showToast( + 'err: live_room : ${videoItem.runtimeType}'); + } + return; + } + if (videoItem case HotVideoItemModel item) { + if (item.redirectUrl?.isNotEmpty == true && + PageUtils.viewPgcFromUri(item.redirectUrl!)) { + return; + } + } + try { + final int? cid = videoItem.cid ?? + await SearchHttp.ab2c( + aid: videoItem.aid, bvid: videoItem.bvid); + if (cid != null) { + PageUtils.toVideoPage( + 'bvid=${videoItem.bvid}&cid=$cid', + arguments: { + 'videoItem': videoItem, + 'heroTag': Utils.makeHeroTag(videoItem.aid) + }, + ); + } + } catch (err) { + SmartDialog.showToast(err.toString()); + } + }, + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: StyleString.safeSpace, + vertical: 5, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AspectRatio( + aspectRatio: StyleString.aspectRatio, + child: LayoutBuilder( + builder: (context, boxConstraints) { + final double maxWidth = boxConstraints.maxWidth; + final double maxHeight = boxConstraints.maxHeight; + num? progress; + if (videoItem case HotVideoItemModel item) { + progress = item.progress; + } + + return Stack( + clipBehavior: Clip.none, + children: [ + NetworkImgLayer( + src: videoItem.cover, + width: maxWidth, + height: maxHeight, + ), + if (videoItem case HotVideoItemModel item) + PBadge( + text: item.pgcLabel, + top: 6.0, + right: 6.0, + ), + if (progress != null && progress != 0) ...[ + PBadge( + text: progress == -1 + ? '已看完' + : '${Utils.timeFormat(progress)}/${Utils.timeFormat(videoItem.duration)}', + right: 6, + bottom: 8, + type: PBadgeType.gray, + ), + Positioned( + left: 0, + bottom: 0, + right: 0, + child: videoProgressIndicator( + progress == -1 + ? 1 + : progress / videoItem.duration, + ), + ) + ] else if (videoItem.duration > 0) + PBadge( + text: Utils.timeFormat(videoItem.duration), + right: 6.0, + bottom: 6.0, + type: PBadgeType.gray, + ), + if (type != 'video') + PBadge( + text: type, + left: 6.0, + bottom: 6.0, + type: PBadgeType.primary, + ), + ], + ); + }, + ), + ), + const SizedBox(width: 10), + content(context), + ], ), ), ), diff --git a/lib/common/widgets/video_card/video_card_v.dart b/lib/common/widgets/video_card/video_card_v.dart index 2f42fb42..646f33f3 100644 --- a/lib/common/widgets/video_card/video_card_v.dart +++ b/lib/common/widgets/video_card/video_card_v.dart @@ -97,50 +97,46 @@ class VideoCardV extends StatelessWidget { return Stack( clipBehavior: Clip.none, children: [ - Semantics( - label: Utils.videoItemSemantics(videoItem), - excludeSemantics: true, - child: Card( - clipBehavior: Clip.hardEdge, - margin: EdgeInsets.zero, - child: InkWell( - onTap: () => onPushDetail(Utils.makeHeroTag(videoItem.aid)), - onLongPress: () => imageSaveDialog( - title: videoItem.title, - cover: videoItem.cover, - bvid: videoItem.bvid, - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AspectRatio( - aspectRatio: StyleString.aspectRatio, - child: LayoutBuilder(builder: (context, boxConstraints) { - double maxWidth = boxConstraints.maxWidth; - double maxHeight = boxConstraints.maxHeight; - return Stack( - clipBehavior: Clip.none, - children: [ - NetworkImgLayer( - src: videoItem.cover, - width: maxWidth, - height: maxHeight, - ), - if (videoItem.duration > 0) - PBadge( - bottom: 6, - right: 7, - size: PBadgeSize.small, - type: PBadgeType.gray, - text: Utils.timeFormat(videoItem.duration), - ) - ], - ); - }), - ), - content(context) - ], - ), + Card( + clipBehavior: Clip.hardEdge, + child: InkWell( + onTap: () => onPushDetail(Utils.makeHeroTag(videoItem.aid)), + onLongPress: () => imageSaveDialog( + title: videoItem.title, + cover: videoItem.cover, + bvid: videoItem.bvid, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AspectRatio( + aspectRatio: StyleString.aspectRatio, + child: LayoutBuilder(builder: (context, boxConstraints) { + double maxWidth = boxConstraints.maxWidth; + double maxHeight = boxConstraints.maxHeight; + return Stack( + clipBehavior: Clip.none, + children: [ + NetworkImgLayer( + src: videoItem.cover, + width: maxWidth, + height: maxHeight, + radius: 0, + ), + if (videoItem.duration > 0) + PBadge( + bottom: 6, + right: 7, + size: PBadgeSize.small, + type: PBadgeType.gray, + text: Utils.timeFormat(videoItem.duration), + ) + ], + ); + }), + ), + content(context) + ], ), ), ), diff --git a/lib/common/widgets/video_popup_menu.dart b/lib/common/widgets/video_popup_menu.dart index 2c9f50f3..ee1599b4 100644 --- a/lib/common/widgets/video_popup_menu.dart +++ b/lib/common/widgets/video_popup_menu.dart @@ -57,9 +57,7 @@ class VideoCustomActions { '访问:${videoItem.owner.name}', 'visit', const Icon(MdiIcons.accountCircleOutline, size: 16), - () => Get.toNamed('/member?mid=${videoItem.owner.mid}', arguments: { - 'heroTag': '${videoItem.owner.mid}', - }), + () => Get.toNamed('/member?mid=${videoItem.owner.mid}'), ), if (videoItem is! SpaceArchiveItem) VideoCustomAction( diff --git a/lib/pages/article_list/widgets/item.dart b/lib/pages/article_list/widgets/item.dart index c43eb385..2c79b560 100644 --- a/lib/pages/article_list/widgets/item.dart +++ b/lib/pages/article_list/widgets/item.dart @@ -17,90 +17,93 @@ class ArticleListItem extends StatelessWidget { @override Widget build(BuildContext context) { final theme = Theme.of(context); - return InkWell( - onTap: () { - final dynIdStr = item.dynIdStr; - Get.toNamed( - '/articlePage', - parameters: { - 'id': dynIdStr ?? item.id!.toString(), - 'type': dynIdStr != null ? 'opus' : 'read', - }, - ); - }, - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: StyleString.safeSpace, - vertical: 5, - ), - child: Row( - spacing: 10, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (item.imageUrls?.isNotEmpty == true) - AspectRatio( - aspectRatio: StyleString.aspectRatio, - child: LayoutBuilder( - builder: (context, boxConstraints) { - return NetworkImgLayer( - src: item.imageUrls!.first, - width: boxConstraints.maxWidth, - height: boxConstraints.maxHeight, - ); - }, - ), - ), - Expanded( - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - item.title!, - style: const TextStyle( - fontSize: 14, - height: 1.42, - letterSpacing: 0.3, - ), - maxLines: 2, - overflow: TextOverflow.ellipsis, + return Material( + type: MaterialType.transparency, + child: InkWell( + onTap: () { + final dynIdStr = item.dynIdStr; + Get.toNamed( + '/articlePage', + parameters: { + 'id': dynIdStr ?? item.id!.toString(), + 'type': dynIdStr != null ? 'opus' : 'read', + }, + ); + }, + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: StyleString.safeSpace, + vertical: 5, + ), + child: Row( + spacing: 10, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (item.imageUrls?.isNotEmpty == true) + AspectRatio( + aspectRatio: StyleString.aspectRatio, + child: LayoutBuilder( + builder: (context, boxConstraints) { + return NetworkImgLayer( + src: item.imageUrls!.first, + width: boxConstraints.maxWidth, + height: boxConstraints.maxHeight, + ); + }, ), - const SizedBox(height: 3), - if (item.summary != null) + ), + Expanded( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ Text( - item.summary!, - style: TextStyle( - fontSize: 12, - color: theme.colorScheme.outline, + item.title!, + style: const TextStyle( + fontSize: 14, + height: 1.42, + letterSpacing: 0.3, ), - maxLines: 1, + maxLines: 2, overflow: TextOverflow.ellipsis, ), - const Spacer(), - Row( - spacing: 16, - children: [ - StatWidget( - value: item.stats?.view, - color: theme.colorScheme.outline, - type: StatType.view, + const SizedBox(height: 3), + if (item.summary != null) + Text( + item.summary!, + style: TextStyle( + fontSize: 12, + color: theme.colorScheme.outline, + ), + maxLines: 1, + overflow: TextOverflow.ellipsis, ), - StatWidget( - type: StatType.like, - value: item.stats?.like, - color: theme.colorScheme.outline, - ), - StatWidget( - type: StatType.reply, - value: item.stats?.reply, - color: theme.colorScheme.outline, - ), - ], - ), - ], + const Spacer(), + Row( + spacing: 16, + children: [ + StatWidget( + value: item.stats?.view, + color: theme.colorScheme.outline, + type: StatType.view, + ), + StatWidget( + type: StatType.like, + value: item.stats?.like, + color: theme.colorScheme.outline, + ), + StatWidget( + type: StatType.reply, + value: item.stats?.reply, + color: theme.colorScheme.outline, + ), + ], + ), + ], + ), ), - ), - ], + ], + ), ), ), ); diff --git a/lib/pages/common/common_slide_page.dart b/lib/pages/common/common_slide_page.dart index cd440531..6c9cfa41 100644 --- a/lib/pages/common/common_slide_page.dart +++ b/lib/pages/common/common_slide_page.dart @@ -54,7 +54,7 @@ abstract class CommonSlidePageState extends State Widget buildList(ThemeData theme) => throw UnimplementedError(); - Widget slideList(ThemeData theme, [Widget? buildList]) => LayoutBuilder( + Widget slideList(ThemeData theme) => LayoutBuilder( builder: (_, constrains) { final maxWidth = constrains.maxWidth; @@ -110,7 +110,7 @@ abstract class CommonSlidePageState extends State onPanEnd: (_) { onDismiss(); }, - child: buildList ?? this.buildList(theme), + child: buildList(theme), ); }, ); diff --git a/lib/pages/dynamics/view.dart b/lib/pages/dynamics/view.dart index bbc69cfd..68691e81 100644 --- a/lib/pages/dynamics/view.dart +++ b/lib/pages/dynamics/view.dart @@ -79,11 +79,10 @@ class _DynamicsPageState extends State Widget upPanelPart(ThemeData theme) { bool isTop = upPanelPosition == UpPanelPosition.top; + bool needBg = isTop || upPanelPosition.index > 1; return Material( - //抽屉模式增加底色 - color: isTop || upPanelPosition.index > 1 - ? theme.colorScheme.surface - : Colors.transparent, + color: needBg ? theme.colorScheme.surface : null, + type: needBg ? MaterialType.canvas : MaterialType.transparency, child: SizedBox( width: isTop ? null : 64, height: isTop ? 76 : null, @@ -120,6 +119,7 @@ class _DynamicsPageState extends State : null, leadingWidth: 50, toolbarHeight: 50, + backgroundColor: Colors.transparent, title: SizedBox( height: 50, child: TabBar( diff --git a/lib/pages/dynamics/widgets/author_panel.dart b/lib/pages/dynamics/widgets/author_panel.dart index 2168ebe1..ac6689c8 100644 --- a/lib/pages/dynamics/widgets/author_panel.dart +++ b/lib/pages/dynamics/widgets/author_panel.dart @@ -77,11 +77,7 @@ class AuthorPanel extends StatelessWidget { ? () { feedBack(); Get.toNamed( - '/member?mid=${item.modules.moduleAuthor!.mid}', - arguments: { - 'face': item.modules.moduleAuthor!.face, - }, - ); + '/member?mid=${item.modules.moduleAuthor!.mid}'); } : null, child: Row( diff --git a/lib/pages/dynamics/widgets/content_panel.dart b/lib/pages/dynamics/widgets/content_panel.dart index 7eae603f..3d622dd6 100644 --- a/lib/pages/dynamics/widgets/content_panel.dart +++ b/lib/pages/dynamics/widgets/content_panel.dart @@ -77,25 +77,23 @@ Widget content( overflow: isSave ? null : TextOverflow.ellipsis, ), if (item.modules.moduleDynamic?.major?.opus?.pics?.isNotEmpty == true) - Text.rich( - WidgetSpan( - child: LayoutBuilder( - builder: (context, constraints) => imageView( - constraints.maxWidth, - item.modules.moduleDynamic!.major!.opus!.pics! - .map( - (item) => ImageModel( - width: item.width, - height: item.height, - url: item.url ?? '', - liveUrl: item.liveUrl, - ), - ) - .toList(), - callback: callback, - ), - ), - ), + LayoutBuilder( + builder: (context, constraints) { + return imageView( + constraints.maxWidth, + item.modules.moduleDynamic!.major!.opus!.pics! + .map( + (item) => ImageModel( + width: item.width, + height: item.height, + url: item.url ?? '', + liveUrl: item.liveUrl, + ), + ) + .toList(), + callback: callback, + ); + }, ), ], ), diff --git a/lib/pages/dynamics/widgets/dynamic_panel.dart b/lib/pages/dynamics/widgets/dynamic_panel.dart index 48aa5f83..f5680ade 100644 --- a/lib/pages/dynamics/widgets/dynamic_panel.dart +++ b/lib/pages/dynamics/widgets/dynamic_panel.dart @@ -42,8 +42,7 @@ class DynamicPanel extends StatelessWidget { onBlock: onBlock, ); final child = Material( - elevation: 0, - color: Colors.transparent, + type: MaterialType.transparency, child: InkWell( onTap: isDetail && !const { diff --git a/lib/pages/dynamics/widgets/live_panel_sub.dart b/lib/pages/dynamics/widgets/live_panel_sub.dart index d4f9ef77..84dec24c 100644 --- a/lib/pages/dynamics/widgets/live_panel_sub.dart +++ b/lib/pages/dynamics/widgets/live_panel_sub.dart @@ -72,7 +72,6 @@ Widget livePanelSub( height: 80, alignment: Alignment.bottomLeft, padding: const EdgeInsets.fromLTRB(12, 0, 10, 10), - clipBehavior: Clip.hardEdge, decoration: BoxDecoration( gradient: const LinearGradient( begin: Alignment.topCenter, diff --git a/lib/pages/dynamics/widgets/live_rcmd_panel.dart b/lib/pages/dynamics/widgets/live_rcmd_panel.dart index e905cba2..8da7e148 100644 --- a/lib/pages/dynamics/widgets/live_rcmd_panel.dart +++ b/lib/pages/dynamics/widgets/live_rcmd_panel.dart @@ -72,7 +72,6 @@ Widget liveRcmdPanel( height: 80, alignment: Alignment.bottomLeft, padding: const EdgeInsets.fromLTRB(12, 0, 10, 10), - clipBehavior: Clip.hardEdge, decoration: BoxDecoration( gradient: const LinearGradient( begin: Alignment.topCenter, diff --git a/lib/pages/dynamics/widgets/module_panel.dart b/lib/pages/dynamics/widgets/module_panel.dart index a92c316e..a6832469 100644 --- a/lib/pages/dynamics/widgets/module_panel.dart +++ b/lib/pages/dynamics/widgets/module_panel.dart @@ -13,6 +13,7 @@ import 'package:PiliPlus/pages/dynamics/widgets/live_rcmd_panel.dart'; import 'package:PiliPlus/pages/dynamics/widgets/video_panel.dart'; import 'package:PiliPlus/utils/page_utils.dart'; import 'package:PiliPlus/utils/utils.dart'; +import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:get/get.dart'; @@ -118,12 +119,7 @@ Widget module( GestureDetector( onTap: isNormalAuth ? () => Get.toNamed( - '/member?mid=${orig.modules.moduleAuthor!.mid}', - arguments: { - 'face': - orig.modules.moduleAuthor!.face - }, - ) + '/member?mid=${orig.modules.moduleAuthor!.mid}') : null, child: Text( '${isNormalAuth ? '@' : ''}${orig.modules.moduleAuthor!.name}', @@ -223,14 +219,17 @@ Widget module( padding: const EdgeInsets.only(left: 12, top: 10, right: 12, bottom: 10), child: Row( + spacing: 10, children: [ - NetworkImgLayer( - radius: 8, - width: 45, - height: 45, - src: item.modules.moduleDynamic!.major!.common!.cover, - ), - const SizedBox(width: 10), + if (item.modules.moduleDynamic!.major!.common!.cover + ?.isNotEmpty == + true) + CachedNetworkImage( + width: 45, + height: 45, + fit: BoxFit.cover, + imageUrl: item.modules.moduleDynamic!.major!.common!.cover!, + ), Expanded( child: Column( spacing: 2, diff --git a/lib/pages/dynamics/widgets/up_panel.dart b/lib/pages/dynamics/widgets/up_panel.dart index b8cf240b..5ae7d252 100644 --- a/lib/pages/dynamics/widgets/up_panel.dart +++ b/lib/pages/dynamics/widgets/up_panel.dart @@ -5,7 +5,6 @@ import 'package:PiliPlus/models/dynamics/up.dart'; import 'package:PiliPlus/pages/dynamics/controller.dart'; import 'package:PiliPlus/pages/live_follow/view.dart'; import 'package:PiliPlus/utils/feed_back.dart'; -import 'package:PiliPlus/utils/utils.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; @@ -155,11 +154,7 @@ class _UpPanelState extends State { onDoubleTap: data is LiveUserItem ? () => _onSelect(data) : null, onLongPress: data.mid == -1 ? null - : () { - String heroTag = Utils.makeHeroTag(data.mid); - Get.toNamed('/member?mid=${data.mid}', - arguments: {'face': data.face, 'heroTag': heroTag}); - }, + : () => Get.toNamed('/member?mid=${data.mid}'), child: AnimatedOpacity( opacity: isCurrent ? 1 : 0.6, duration: const Duration(milliseconds: 200), diff --git a/lib/pages/dynamics/widgets/video_panel.dart b/lib/pages/dynamics/widgets/video_panel.dart index db972693..a7225508 100644 --- a/lib/pages/dynamics/widgets/video_panel.dart +++ b/lib/pages/dynamics/widgets/video_panel.dart @@ -88,7 +88,6 @@ Widget videoSeasonWidget( height: 70, alignment: Alignment.bottomLeft, padding: const EdgeInsets.fromLTRB(10, 0, 8, 8), - clipBehavior: Clip.hardEdge, decoration: const BoxDecoration( gradient: LinearGradient( begin: Alignment.topCenter, @@ -146,12 +145,14 @@ Widget videoSeasonWidget( mainAxisAlignment: MainAxisAlignment.start, children: [ if (itemContent.cover != null) - Padding( - padding: floor == 1 - ? const EdgeInsets.symmetric(horizontal: StyleString.safeSpace) - : EdgeInsets.zero, - child: buildCover(), - ), + if (floor == 1) + Padding( + padding: + const EdgeInsets.symmetric(horizontal: StyleString.safeSpace), + child: buildCover(), + ) + else + buildCover(), const SizedBox(height: 6), if (itemContent.title != null) Padding( diff --git a/lib/pages/dynamics_create/view.dart b/lib/pages/dynamics_create/view.dart index 72f389ad..a6f2f4b9 100644 --- a/lib/pages/dynamics_create/view.dart +++ b/lib/pages/dynamics_create/view.dart @@ -1,5 +1,6 @@ import 'dart:math'; +import 'package:PiliPlus/common/constants.dart'; import 'package:PiliPlus/common/widgets/button/icon_button.dart'; import 'package:PiliPlus/common/widgets/button/toolbar_icon_button.dart'; import 'package:PiliPlus/common/widgets/custom_icon.dart'; @@ -246,8 +247,7 @@ class _CreateDynPanelState extends CommonPublishPageState { if (pathList.length != limit) Builder( builder: (context) { - const borderRadius = - BorderRadius.all(Radius.circular(10)); + const borderRadius = StyleString.mdRadius; return Material( borderRadius: borderRadius, child: InkWell( diff --git a/lib/pages/dynamics_select_topic/view.dart b/lib/pages/dynamics_select_topic/view.dart index b0a3d305..bfac0348 100644 --- a/lib/pages/dynamics_select_topic/view.dart +++ b/lib/pages/dynamics_select_topic/view.dart @@ -129,10 +129,7 @@ class _SelectTopicPanelState extends State { ), ), Expanded( - child: Material( - color: Colors.transparent, - child: Obx(() => _buildBody(theme, _controller.loadingState.value)), - ), + child: Obx(() => _buildBody(theme, _controller.loadingState.value)), ), ], ); diff --git a/lib/pages/dynamics_select_topic/widgets/item.dart b/lib/pages/dynamics_select_topic/widgets/item.dart index 1ca8e8be..e5dfd845 100644 --- a/lib/pages/dynamics_select_topic/widgets/item.dart +++ b/lib/pages/dynamics_select_topic/widgets/item.dart @@ -15,34 +15,37 @@ class DynTopicItem extends StatelessWidget { @override Widget build(BuildContext context) { - return ListTile( - dense: true, - onTap: () => onTap(item), - title: Text.rich( - TextSpan( - children: [ - const WidgetSpan( - alignment: PlaceholderAlignment.middle, - child: Padding( - padding: EdgeInsets.only(right: 5), - child: Icon( - CustomIcon.topic_tag, - size: 18, + return Material( + type: MaterialType.transparency, + child: ListTile( + dense: true, + onTap: () => onTap(item), + title: Text.rich( + TextSpan( + children: [ + const WidgetSpan( + alignment: PlaceholderAlignment.middle, + child: Padding( + padding: EdgeInsets.only(right: 5), + child: Icon( + CustomIcon.topic_tag, + size: 18, + ), ), ), - ), - TextSpan( - text: item.name, - style: const TextStyle(fontSize: 14), - ), - ], + TextSpan( + text: item.name, + style: const TextStyle(fontSize: 14), + ), + ], + ), ), - ), - subtitle: Padding( - padding: const EdgeInsets.only(left: 23), - child: Text( - '${Utils.numFormat(item.view)}浏览 · ${Utils.numFormat(item.discuss)}讨论', - style: TextStyle(color: Theme.of(context).colorScheme.outline), + subtitle: Padding( + padding: const EdgeInsets.only(left: 23), + child: Text( + '${Utils.numFormat(item.view)}浏览 · ${Utils.numFormat(item.discuss)}讨论', + style: TextStyle(color: Theme.of(context).colorScheme.outline), + ), ), ), ); diff --git a/lib/pages/emote/view.dart b/lib/pages/emote/view.dart index 0182f71f..cef6836a 100644 --- a/lib/pages/emote/view.dart +++ b/lib/pages/emote/view.dart @@ -62,7 +62,7 @@ class _EmotePanelState extends State itemCount: e.emote!.length, itemBuilder: (context, index) { return Material( - color: Colors.transparent, + type: MaterialType.transparency, child: InkWell( borderRadius: const BorderRadius.all(Radius.circular(8)), @@ -120,7 +120,7 @@ class _EmotePanelState extends State ), Expanded( child: Material( - color: Colors.transparent, + type: MaterialType.transparency, child: TabBar( controller: _emotePanelController.tabController, padding: const EdgeInsets.only(right: 60), diff --git a/lib/pages/episode_panel/view.dart b/lib/pages/episode_panel/view.dart index 76cf3c5b..08193525 100644 --- a/lib/pages/episode_panel/view.dart +++ b/lib/pages/episode_panel/view.dart @@ -47,7 +47,7 @@ class EpisodePanel extends CommonSlidePage { required this.bvid, required this.cid, required this.cover, - this.showTitle, + this.showTitle = true, required this.list, this.seasonId, this.initialTabIndex = 0, @@ -67,7 +67,7 @@ class EpisodePanel extends CommonSlidePage { final String bvid; final int cid; final String? cover; - final bool? showTitle; + final bool showTitle; final List list; final int? seasonId; final int initialTabIndex; @@ -116,7 +116,7 @@ class _EpisodePanelState extends CommonSlidePageState { @override void didUpdateWidget(EpisodePanel oldWidget) { super.didUpdateWidget(oldWidget); - if (widget.showTitle != false) { + if (widget.showTitle) { return; } @@ -237,26 +237,22 @@ class _EpisodePanelState extends CommonSlidePageState { } return Material( - color: widget.showTitle == false - ? Colors.transparent - : theme.colorScheme.surface, + color: widget.showTitle ? theme.colorScheme.surface : null, + type: widget.showTitle ? MaterialType.canvas : MaterialType.transparency, child: Column( children: [ _buildToolbar(theme), if (isMulti) ...[ tabbar(), Expanded( - child: Material( - color: Colors.transparent, - child: tabBarView( - controller: _tabController, - children: List.generate( - widget.list.length, - (index) => _buildBody( - theme, - index, - widget.list[index].episodes, - ), + child: tabBarView( + controller: _tabController, + children: List.generate( + widget.list.length, + (index) => _buildBody( + theme, + index, + widget.list[index].episodes, ), ), ), @@ -270,10 +266,7 @@ class _EpisodePanelState extends CommonSlidePageState { @override Widget buildList(ThemeData theme) { - return Material( - color: Colors.transparent, - child: _buildBody(theme, 0, _getCurrEpisodes), - ); + return _buildBody(theme, 0, _getCurrEpisodes); } Widget _buildBody(ThemeData theme, int tabIndex, episodes) { @@ -288,22 +281,23 @@ class _EpisodePanelState extends CommonSlidePageState { physics: const AlwaysScrollableScrollPhysics(), itemBuilder: (BuildContext context, int itemIndex) { final episode = episodes[itemIndex]; + Widget episodeItem = _buildEpisodeItem( + theme: theme, + episode: episode, + index: itemIndex, + length: episodes.length, + isCurrentIndex: tabIndex == widget.initialTabIndex + ? itemIndex == _currentItemIndex + : false, + ); return widget.type == EpisodeType.season && - widget.showTitle != false && + widget.showTitle && episode.pages.length > 1 ? Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ - _buildEpisodeItem( - theme: theme, - episode: episode, - index: itemIndex, - length: episodes.length, - isCurrentIndex: tabIndex == widget.initialTabIndex - ? itemIndex == _currentItemIndex - : false, - ), + episodeItem, Padding( padding: const EdgeInsets.symmetric( horizontal: 12, vertical: 5), @@ -321,15 +315,7 @@ class _EpisodePanelState extends CommonSlidePageState { ), ], ) - : _buildEpisodeItem( - theme: theme, - episode: episode, - index: itemIndex, - length: episodes.length, - isCurrentIndex: tabIndex == widget.initialTabIndex - ? itemIndex == _currentItemIndex - : false, - ); + : episodeItem; }, itemScrollController: _itemScrollController[tabIndex], separatorBuilder: (context, index) => const SizedBox(height: 2), @@ -385,10 +371,10 @@ class _EpisodePanelState extends CommonSlidePageState { } late final Color primary = theme.colorScheme.primary; - return Material( - color: Colors.transparent, - child: SizedBox( - height: 98, + return SizedBox( + height: 98, + child: Material( + type: MaterialType.transparency, child: InkWell( onTap: () { if (episode.badge != null && episode.badge == "会员") { @@ -401,7 +387,7 @@ class _EpisodePanelState extends CommonSlidePageState { } SmartDialog.showToast('切换到:$title'); widget.onClose?.call(); - if (widget.showTitle == false) { + if (!widget.showTitle) { _currentItemIndex = index; } widget.changeFucCall( @@ -573,8 +559,7 @@ class _EpisodePanelState extends CommonSlidePageState { Widget _buildToolbar(ThemeData theme) => Container( height: 45, - padding: EdgeInsets.symmetric( - horizontal: widget.showTitle != false ? 14 : 6), + padding: EdgeInsets.symmetric(horizontal: widget.showTitle ? 14 : 6), decoration: BoxDecoration( border: Border( bottom: BorderSide( @@ -584,7 +569,7 @@ class _EpisodePanelState extends CommonSlidePageState { ), child: Row( children: [ - if (widget.showTitle != false) + if (widget.showTitle) Text( widget.type.title, style: theme.textTheme.titleMedium, diff --git a/lib/pages/fan/view.dart b/lib/pages/fan/view.dart index 95c2a028..8673c488 100644 --- a/lib/pages/fan/view.dart +++ b/lib/pages/fan/view.dart @@ -100,7 +100,6 @@ class _FansPageState extends State { _fansController.onLoadMore(); } final item = response[index]; - String heroTag = Utils.makeHeroTag(item.mid); return ListTile( onTap: () { if (widget.onSelect != null) { @@ -111,10 +110,7 @@ class _FansPageState extends State { )); return; } - Get.toNamed( - '/member?mid=${item.mid}', - arguments: {'face': item.face, 'heroTag': heroTag}, - ); + Get.toNamed('/member?mid=${item.mid}'); }, onLongPress: widget.onSelect != null ? null @@ -126,14 +122,11 @@ class _FansPageState extends State { index, item.mid!), ) : null, - leading: Hero( - tag: heroTag, - child: NetworkImgLayer( - width: 45, - height: 45, - type: ImageType.avatar, - src: item.face, - ), + leading: NetworkImgLayer( + width: 45, + height: 45, + type: ImageType.avatar, + src: item.face, ), title: Text( item.uname!, diff --git a/lib/pages/fav/article/widget/item.dart b/lib/pages/fav/article/widget/item.dart index 1e7fe670..bcd8cf51 100644 --- a/lib/pages/fav/article/widget/item.dart +++ b/lib/pages/fav/article/widget/item.dart @@ -21,7 +21,7 @@ class FavArticleItem extends StatelessWidget { Widget build(BuildContext context) { final theme = Theme.of(context); return Material( - color: Colors.transparent, + type: MaterialType.transparency, child: Stack( clipBehavior: Clip.none, children: [ diff --git a/lib/pages/fav/note/widget/item.dart b/lib/pages/fav/note/widget/item.dart index e1f5f907..67d7fee2 100644 --- a/lib/pages/fav/note/widget/item.dart +++ b/lib/pages/fav/note/widget/item.dart @@ -21,7 +21,7 @@ class FavNoteItem extends StatelessWidget { Widget build(BuildContext context) { final theme = Theme.of(context); return Material( - color: Colors.transparent, + type: MaterialType.transparency, child: InkWell( onTap: () { if (ctr.enableMultiSelect.value) { diff --git a/lib/pages/fav/pgc/widget/item.dart b/lib/pages/fav/pgc/widget/item.dart index ab7b1665..f353edcc 100644 --- a/lib/pages/fav/pgc/widget/item.dart +++ b/lib/pages/fav/pgc/widget/item.dart @@ -26,7 +26,7 @@ class FavPgcItem extends StatelessWidget { Widget build(BuildContext context) { final theme = Theme.of(context); return Material( - color: Colors.transparent, + type: MaterialType.transparency, child: Stack( clipBehavior: Clip.none, children: [ diff --git a/lib/pages/fav/video/widgets/item.dart b/lib/pages/fav/video/widgets/item.dart index 18d38802..ca9d4d48 100644 --- a/lib/pages/fav/video/widgets/item.dart +++ b/lib/pages/fav/video/widgets/item.dart @@ -21,39 +21,42 @@ class FavVideoItem extends StatelessWidget { @override Widget build(BuildContext context) { - return InkWell( - onTap: onTap, - onLongPress: onLongPress ?? - (onTap == null - ? null - : () => imageSaveDialog( - title: item.title, - cover: item.cover, - )), - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 5), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AspectRatio( - aspectRatio: StyleString.aspectRatio, - child: LayoutBuilder( - builder: (context, boxConstraints) { - return Hero( - tag: heroTag, - child: NetworkImgLayer( - src: item.cover, - width: boxConstraints.maxWidth, - height: boxConstraints.maxHeight, - ), - ); - }, + return Material( + type: MaterialType.transparency, + child: InkWell( + onTap: onTap, + onLongPress: onLongPress ?? + (onTap == null + ? null + : () => imageSaveDialog( + title: item.title, + cover: item.cover, + )), + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 5), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AspectRatio( + aspectRatio: StyleString.aspectRatio, + child: LayoutBuilder( + builder: (context, boxConstraints) { + return Hero( + tag: heroTag, + child: NetworkImgLayer( + src: item.cover, + width: boxConstraints.maxWidth, + height: boxConstraints.maxHeight, + ), + ); + }, + ), ), - ), - const SizedBox(width: 10), - content(context), - ], + const SizedBox(width: 10), + content(context), + ], + ), ), ), ); diff --git a/lib/pages/fav_detail/widget/fav_video_card.dart b/lib/pages/fav_detail/widget/fav_video_card.dart index b56d4fe1..8d575d45 100644 --- a/lib/pages/fav_detail/widget/fav_video_card.dart +++ b/lib/pages/fav_detail/widget/fav_video_card.dart @@ -33,79 +33,82 @@ class FavVideoCardH extends StatelessWidget { @override Widget build(BuildContext context) { - return InkWell( - onTap: isSort == true - ? null - : onTap ?? - () { - if (!const [0, 16].contains(item.attr)) { - Get.toNamed('/member?mid=${item.upper?.mid}'); - return; - } + return Material( + type: MaterialType.transparency, + child: InkWell( + onTap: isSort == true + ? null + : onTap ?? + () { + if (!const [0, 16].contains(item.attr)) { + Get.toNamed('/member?mid=${item.upper?.mid}'); + return; + } - // pgc - if (item.type == 24) { - PageUtils.viewPgc( - seasonId: item.ogv!.seasonId, - epId: item.id, - ); - return; - } + // pgc + if (item.type == 24) { + PageUtils.viewPgc( + seasonId: item.ogv!.seasonId, + epId: item.id, + ); + return; + } - onViewFav?.call(); - }, - onLongPress: isSort == true - ? null - : onLongPress ?? - () => imageSaveDialog( - title: item.title, - cover: item.cover, - bvid: item.bvid, - ), - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: StyleString.safeSpace, - vertical: 5, - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AspectRatio( - aspectRatio: StyleString.aspectRatio, - child: LayoutBuilder( - builder: (context, boxConstraints) { - double maxWidth = boxConstraints.maxWidth; - double maxHeight = boxConstraints.maxHeight; - return Stack( - clipBehavior: Clip.none, - children: [ - NetworkImgLayer( - src: item.cover, - width: maxWidth, - height: maxHeight, - ), - PBadge( - text: Utils.timeFormat(item.duration), - right: 6.0, - bottom: 6.0, - type: PBadgeType.gray, - ), - PBadge( - text: item.ogv?.typeName, - top: 6.0, - right: 6.0, - bottom: null, - left: null, - ), - ], - ); + onViewFav?.call(); }, + onLongPress: isSort == true + ? null + : onLongPress ?? + () => imageSaveDialog( + title: item.title, + cover: item.cover, + bvid: item.bvid, + ), + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: StyleString.safeSpace, + vertical: 5, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AspectRatio( + aspectRatio: StyleString.aspectRatio, + child: LayoutBuilder( + builder: (context, boxConstraints) { + double maxWidth = boxConstraints.maxWidth; + double maxHeight = boxConstraints.maxHeight; + return Stack( + clipBehavior: Clip.none, + children: [ + NetworkImgLayer( + src: item.cover, + width: maxWidth, + height: maxHeight, + ), + PBadge( + text: Utils.timeFormat(item.duration), + right: 6.0, + bottom: 6.0, + type: PBadgeType.gray, + ), + PBadge( + text: item.ogv?.typeName, + top: 6.0, + right: 6.0, + bottom: null, + left: null, + ), + ], + ); + }, + ), ), - ), - const SizedBox(width: 10), - content(context), - ], + const SizedBox(width: 10), + content(context), + ], + ), ), ), ); diff --git a/lib/pages/fav_panel/view.dart b/lib/pages/fav_panel/view.dart index a234258d..2b8f39c1 100644 --- a/lib/pages/fav_panel/view.dart +++ b/lib/pages/fav_panel/view.dart @@ -81,13 +81,13 @@ class _FavPanelState extends State { Map data = snapshot.data as Map; if (data['status']) { return Obx( - () => Material( - color: Colors.transparent, - child: ListView.builder( - controller: widget.scrollController, - itemCount: widget.ctr.favFolderData.value.list.length, - itemBuilder: (context, index) { - return ListTile( + () => ListView.builder( + controller: widget.scrollController, + itemCount: widget.ctr.favFolderData.value.list.length, + itemBuilder: (context, index) { + return Material( + type: MaterialType.transparency, + child: ListTile( onTap: () => widget.ctr.onChoose( widget.ctr.favFolderData.value.list[index] .favState != @@ -114,9 +114,9 @@ class _FavPanelState extends State { widget.ctr.onChoose(checkValue!, index), ), ), - ); - }, - ), + ), + ); + }, ), ); } else { diff --git a/lib/pages/follow/child/child_view.dart b/lib/pages/follow/child/child_view.dart index e974b488..e3ab883b 100644 --- a/lib/pages/follow/child/child_view.dart +++ b/lib/pages/follow/child/child_view.dart @@ -44,19 +44,26 @@ class _FollowChildPageState extends State super.build(context); if (widget.onSelect != null || (widget.controller?.isOwner == true && widget.tagid == null)) { - return Scaffold( - backgroundColor: Colors.transparent, - body: _child, - floatingActionButton: FloatingActionButton.extended( - onPressed: () => _followController - ..orderType.value = - _followController.orderType.value == FollowOrderType.def - ? FollowOrderType.attention - : FollowOrderType.def - ..onReload(), - icon: const Icon(Icons.format_list_bulleted, size: 20), - label: Obx(() => Text(_followController.orderType.value.title)), - ), + final padding = MediaQuery.paddingOf(context); + return Stack( + clipBehavior: Clip.none, + children: [ + _child, + Positioned( + right: 16 + padding.right, + bottom: 16 + padding.bottom, + child: FloatingActionButton.extended( + onPressed: () => _followController + ..orderType.value = + _followController.orderType.value == FollowOrderType.def + ? FollowOrderType.attention + : FollowOrderType.def + ..onReload(), + icon: const Icon(Icons.format_list_bulleted, size: 20), + label: Obx(() => Text(_followController.orderType.value.title)), + ), + ), + ], ); } return _child; diff --git a/lib/pages/follow/view.dart b/lib/pages/follow/view.dart index 79c26d7b..ee25416a 100644 --- a/lib/pages/follow/view.dart +++ b/lib/pages/follow/view.dart @@ -139,12 +139,9 @@ class _FollowPageState extends State { ), ), Expanded( - child: Material( - color: Colors.transparent, - child: tabBarView( - controller: _followController.tabController, - children: _followController.tabs.map(_childPage).toList(), - ), + child: tabBarView( + controller: _followController.tabController, + children: _followController.tabs.map(_childPage).toList(), ), ), ], diff --git a/lib/pages/follow/widgets/follow_item.dart b/lib/pages/follow/widgets/follow_item.dart index ae66c88b..d90cbc22 100644 --- a/lib/pages/follow/widgets/follow_item.dart +++ b/lib/pages/follow/widgets/follow_item.dart @@ -4,7 +4,6 @@ import 'package:PiliPlus/models_new/follow/list.dart'; import 'package:PiliPlus/pages/share/view.dart' show UserModel; import 'package:PiliPlus/utils/feed_back.dart'; import 'package:PiliPlus/utils/request_utils.dart'; -import 'package:PiliPlus/utils/utils.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; @@ -25,92 +24,91 @@ class FollowItem extends StatelessWidget { @override Widget build(BuildContext context) { final theme = Theme.of(context); - String heroTag = Utils.makeHeroTag(item.mid); - return ListTile( - onTap: () { - if (onSelect != null) { - onSelect!.call( - UserModel( - mid: item.mid!, - name: item.uname!, - avatar: item.face!, - ), - ); - } else { - feedBack(); - Get.toNamed('/member?mid=${item.mid}', - arguments: {'face': item.face, 'heroTag': heroTag}); - } - }, - leading: Stack( - clipBehavior: Clip.none, - children: [ - Hero( - tag: heroTag, - child: NetworkImgLayer( + return Material( + type: MaterialType.transparency, + child: ListTile( + onTap: () { + if (onSelect != null) { + onSelect!.call( + UserModel( + mid: item.mid!, + name: item.uname!, + avatar: item.face!, + ), + ); + } else { + feedBack(); + Get.toNamed('/member?mid=${item.mid}'); + } + }, + leading: Stack( + clipBehavior: Clip.none, + children: [ + NetworkImgLayer( width: 45, height: 45, type: ImageType.avatar, src: item.face, ), - ), - if (item.officialVerify?.type == 0 || item.officialVerify?.type == 1) - Positioned( - bottom: 0, - right: 0, - child: DecoratedBox( - decoration: BoxDecoration( - shape: BoxShape.circle, - color: theme.colorScheme.surface, - ), - child: Icon( - Icons.offline_bolt, - color: item.officialVerify?.type == 0 - ? const Color(0xFFFFCC00) - : Colors.lightBlueAccent, - size: 14, + if (item.officialVerify?.type == 0 || + item.officialVerify?.type == 1) + Positioned( + bottom: 0, + right: 0, + child: DecoratedBox( + decoration: BoxDecoration( + shape: BoxShape.circle, + color: theme.colorScheme.surface, + ), + child: Icon( + Icons.offline_bolt, + color: item.officialVerify?.type == 0 + ? const Color(0xFFFFCC00) + : Colors.lightBlueAccent, + size: 14, + ), ), ), - ), - ], - ), - title: Text( - item.uname!, - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: const TextStyle(fontSize: 14), - ), - subtitle: Text( - item.sign!, - maxLines: 1, - overflow: TextOverflow.ellipsis, - ), - dense: true, - trailing: isOwner == true - ? SizedBox( - height: 34, - child: FilledButton.tonal( - onPressed: () => RequestUtils.actionRelationMod( - context: context, - mid: item.mid, - isFollow: item.attribute != -1, - callback: callback, + ], + ), + title: Text( + item.uname!, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: const TextStyle(fontSize: 14), + ), + subtitle: Text( + item.sign!, + maxLines: 1, + overflow: TextOverflow.ellipsis, + ), + dense: true, + trailing: isOwner == true + ? SizedBox( + height: 34, + child: FilledButton.tonal( + onPressed: () => RequestUtils.actionRelationMod( + context: context, + mid: item.mid, + isFollow: item.attribute != -1, + callback: callback, + ), + style: FilledButton.styleFrom( + padding: const EdgeInsets.fromLTRB(15, 0, 15, 0), + foregroundColor: + item.attribute == -1 ? null : theme.colorScheme.outline, + backgroundColor: item.attribute == -1 + ? null + : theme.colorScheme.onInverseSurface, + ), + child: Text( + '${item.attribute == -1 ? '' : '已'}关注', + style: const TextStyle(fontSize: 12), + ), ), - style: FilledButton.styleFrom( - padding: const EdgeInsets.fromLTRB(15, 0, 15, 0), - foregroundColor: - item.attribute == -1 ? null : theme.colorScheme.outline, - backgroundColor: item.attribute == -1 - ? null - : theme.colorScheme.onInverseSurface, - ), - child: Text( - '${item.attribute == -1 ? '' : '已'}关注', - style: const TextStyle(fontSize: 12), - ), - ), - ) - : null, + ) + : null, + ), ); } } diff --git a/lib/pages/group_panel/view.dart b/lib/pages/group_panel/view.dart index e08b4b4a..87baea1a 100644 --- a/lib/pages/group_panel/view.dart +++ b/lib/pages/group_panel/view.dart @@ -95,13 +95,13 @@ class _GroupPanelState extends State { } Map data = snapshot.data as Map; if (data['status']) { - return Material( - color: Colors.transparent, - child: ListView.builder( - controller: widget.scrollController, - itemCount: tagsList.length, - itemBuilder: (context, index) { - return ListTile( + return ListView.builder( + controller: widget.scrollController, + itemCount: tagsList.length, + itemBuilder: (context, index) { + return Material( + type: MaterialType.transparency, + child: ListTile( onTap: () { tagsList[index].checked = !tagsList[index].checked!; showDefaultBtn = @@ -127,9 +127,9 @@ class _GroupPanelState extends State { }, ), ), - ); - }, - ), + ), + ); + }, ); } else { return CustomScrollView( diff --git a/lib/pages/history/view.dart b/lib/pages/history/view.dart index 6eca5f58..40168b8a 100644 --- a/lib/pages/history/view.dart +++ b/lib/pages/history/view.dart @@ -204,22 +204,18 @@ class _HistoryPageState extends State ], ), Expanded( - child: Material( - color: Colors.transparent, - child: TabBarView( - physics: enableMultiSelect - ? const NeverScrollableScrollPhysics() - : const CustomTabBarViewScrollPhysics(), - controller: - _historyController.tabController, - children: [ - KeepAliveWrapper( - builder: (context) => _buildPage), - ..._historyController.tabs.map( - (item) => HistoryPage(type: item.type), - ), - ], - ), + child: TabBarView( + physics: enableMultiSelect + ? const NeverScrollableScrollPhysics() + : const CustomTabBarViewScrollPhysics(), + controller: _historyController.tabController, + children: [ + KeepAliveWrapper( + builder: (context) => _buildPage), + ..._historyController.tabs.map( + (item) => HistoryPage(type: item.type), + ), + ], ), ), ], diff --git a/lib/pages/history/widgets/item.dart b/lib/pages/history/widgets/item.dart index fe01fdb1..bde71ffa 100644 --- a/lib/pages/history/widgets/item.dart +++ b/lib/pages/history/widgets/item.dart @@ -38,256 +38,257 @@ class HistoryItem extends StatelessWidget { final theme = Theme.of(context); int aid = item.history.oid!; String bvid = item.history.bvid ?? IdUtils.av2bv(aid); - return InkWell( - onTap: () async { - if (ctr is MultiSelectController || ctr is HistoryBaseController) { - if (ctr.enableMultiSelect.value) { - onChoose?.call(); - return; + return Material( + type: MaterialType.transparency, + child: InkWell( + onTap: () async { + if (ctr is MultiSelectController || ctr is HistoryBaseController) { + if (ctr.enableMultiSelect.value) { + onChoose?.call(); + return; + } } - } - if (item.history.business?.contains('article') == true) { - PageUtils.toDupNamed( - '/articlePage', - parameters: { - 'id': item.history.business == 'article-list' - ? '${item.history.cid}' - : '${item.history.oid}', - 'type': 'read', - }, - ); - } else if (item.history.business == 'live') { - if (item.liveStatus == 1) { - Get.toNamed('/liveRoom?roomid=${item.history.oid}'); - } else { - SmartDialog.showToast('直播未开播'); - } - } else if (item.history.business == 'pgc') { - PageUtils.viewPgc(epId: item.history.epid); - } else { - int? cid = item.history.cid ?? - await SearchHttp.ab2c( - aid: aid, - bvid: bvid, - part: item.history.page, - ); - if (cid != null) { - PageUtils.toVideoPage( - 'bvid=$bvid&cid=$cid', - arguments: { - 'heroTag': Utils.makeHeroTag(aid), - 'pic': item.cover, + if (item.history.business?.contains('article') == true) { + PageUtils.toDupNamed( + '/articlePage', + parameters: { + 'id': item.history.business == 'article-list' + ? '${item.history.cid}' + : '${item.history.oid}', + 'type': 'read', }, ); + } else if (item.history.business == 'live') { + if (item.liveStatus == 1) { + Get.toNamed('/liveRoom?roomid=${item.history.oid}'); + } else { + SmartDialog.showToast('直播未开播'); + } + } else if (item.history.business == 'pgc') { + PageUtils.viewPgc(epId: item.history.epid); + } else { + int? cid = item.history.cid ?? + await SearchHttp.ab2c( + aid: aid, + bvid: bvid, + part: item.history.page, + ); + if (cid != null) { + PageUtils.toVideoPage( + 'bvid=$bvid&cid=$cid', + arguments: { + 'heroTag': Utils.makeHeroTag(aid), + 'pic': item.cover, + }, + ); + } } - } - }, - onLongPress: () { - if (ctr is MultiSelectController || ctr is HistoryBaseController) { - if (!ctr.enableMultiSelect.value) { - ctr.enableMultiSelect.value = true; - onChoose?.call(); + }, + onLongPress: () { + if (ctr is MultiSelectController || ctr is HistoryBaseController) { + if (!ctr.enableMultiSelect.value) { + ctr.enableMultiSelect.value = true; + onChoose?.call(); + } + return; } - return; - } - imageSaveDialog( - title: item.title, - cover: item.cover, - bvid: bvid, - ); - }, - child: Stack( - clipBehavior: Clip.none, - children: [ - Padding( - padding: const EdgeInsets.symmetric( - horizontal: StyleString.safeSpace, - vertical: 5, - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AspectRatio( - aspectRatio: StyleString.aspectRatio, - child: LayoutBuilder( - builder: (context, boxConstraints) { - double maxWidth = boxConstraints.maxWidth; - double maxHeight = boxConstraints.maxHeight; - return Stack( - clipBehavior: Clip.none, - children: [ - NetworkImgLayer( - src: item.cover?.isNotEmpty == true - ? item.cover - : item.covers?.firstOrNull ?? '', - width: maxWidth, - height: maxHeight, - ), - if (!HistoryBusinessType.hiddenDurationType - .contains(item.history.business)) - PBadge( - text: item.progress == -1 - ? '已看完' - : '${Utils.timeFormat(item.progress)}/${Utils.timeFormat(item.duration!)}', - right: 6.0, - bottom: 8.0, - type: PBadgeType.gray, + imageSaveDialog( + title: item.title, + cover: item.cover, + bvid: bvid, + ); + }, + child: Stack( + clipBehavior: Clip.none, + children: [ + Padding( + padding: const EdgeInsets.symmetric( + horizontal: StyleString.safeSpace, + vertical: 5, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AspectRatio( + aspectRatio: StyleString.aspectRatio, + child: LayoutBuilder( + builder: (context, boxConstraints) { + double maxWidth = boxConstraints.maxWidth; + double maxHeight = boxConstraints.maxHeight; + return Stack( + clipBehavior: Clip.none, + children: [ + NetworkImgLayer( + src: item.cover?.isNotEmpty == true + ? item.cover + : item.covers?.firstOrNull ?? '', + width: maxWidth, + height: maxHeight, ), - // 右上角 - if (HistoryBusinessType.showBadge - .contains(item.history.business) || - item.history.business == - HistoryBusinessType.live.type) - PBadge( - text: item.badge, - top: 6.0, - right: 6.0, - type: item.history.business == - HistoryBusinessType.live.type && - item.liveStatus != 1 - ? PBadgeType.gray - : PBadgeType.primary, - ), - if (item.duration != null && - item.duration != 0 && - item.progress != null && - item.progress != 0) - Positioned( - left: 0, - right: 0, - bottom: 0, - child: videoProgressIndicator( - item.progress == -1 - ? 1 - : item.progress! / item.duration!, + if (!HistoryBusinessType.hiddenDurationType + .contains(item.history.business)) + PBadge( + text: item.progress == -1 + ? '已看完' + : '${Utils.timeFormat(item.progress)}/${Utils.timeFormat(item.duration!)}', + right: 6.0, + bottom: 8.0, + type: PBadgeType.gray, ), - ), - Positioned.fill( - child: AnimatedOpacity( - opacity: item.checked == true ? 1 : 0, - duration: const Duration(milliseconds: 200), - child: Container( - alignment: Alignment.center, - decoration: BoxDecoration( - borderRadius: StyleString.mdRadius, - color: Colors.black.withValues(alpha: 0.6), + // 右上角 + if (HistoryBusinessType.showBadge + .contains(item.history.business) || + item.history.business == + HistoryBusinessType.live.type) + PBadge( + text: item.badge, + top: 6.0, + right: 6.0, + type: item.history.business == + HistoryBusinessType.live.type && + item.liveStatus != 1 + ? PBadgeType.gray + : PBadgeType.primary, + ), + if (item.duration != null && + item.duration != 0 && + item.progress != null && + item.progress != 0) + Positioned( + left: 0, + right: 0, + bottom: 0, + child: videoProgressIndicator( + item.progress == -1 + ? 1 + : item.progress! / item.duration!, ), - child: SizedBox( - width: 34, - height: 34, - child: AnimatedScale( - scale: item.checked == true ? 1 : 0, - duration: const Duration(milliseconds: 250), - curve: Curves.easeInOut, - child: IconButton( - tooltip: '取消选择', - style: ButtonStyle( - padding: WidgetStateProperty.all( - EdgeInsets.zero), - backgroundColor: - WidgetStateProperty.resolveWith( - (states) { - return theme.colorScheme.surface - .withValues(alpha: 0.8); - }, + ), + Positioned.fill( + child: AnimatedOpacity( + opacity: item.checked == true ? 1 : 0, + duration: const Duration(milliseconds: 200), + child: Container( + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: StyleString.mdRadius, + color: Colors.black.withValues(alpha: 0.6), + ), + child: SizedBox( + width: 34, + height: 34, + child: AnimatedScale( + scale: item.checked == true ? 1 : 0, + duration: + const Duration(milliseconds: 250), + curve: Curves.easeInOut, + child: IconButton( + tooltip: '取消选择', + style: ButtonStyle( + padding: WidgetStateProperty.all( + EdgeInsets.zero), + backgroundColor: + WidgetStateProperty.resolveWith( + (states) { + return theme.colorScheme.surface + .withValues(alpha: 0.8); + }, + ), ), + onPressed: () { + feedBack(); + onChoose?.call(); + }, + icon: Icon(Icons.done_all_outlined, + color: theme.colorScheme.primary), ), - onPressed: () { - feedBack(); - onChoose?.call(); - }, - icon: Icon(Icons.done_all_outlined, - color: theme.colorScheme.primary), ), ), ), ), ), - ), - ], - ); - }, - ), - ), - const SizedBox(width: 10), - content(theme), - ], - ), - ), - Positioned( - right: 12, - bottom: 0, - child: SizedBox( - width: 29, - height: 29, - child: PopupMenuButton( - padding: EdgeInsets.zero, - tooltip: '功能菜单', - icon: Icon( - Icons.more_vert_outlined, - color: theme.colorScheme.outline, - size: 18, - ), - position: PopupMenuPosition.under, - itemBuilder: (BuildContext context) => >[ - if (item.authorMid != null && - item.authorName?.isNotEmpty == true) - PopupMenuItem( - onTap: () => Get.toNamed( - '/member?mid=${item.authorMid}', - arguments: { - 'heroTag': '${item.authorMid}', - }, - ), - height: 35, - child: Row( - children: [ - const Icon(MdiIcons.accountCircleOutline, size: 16), - const SizedBox(width: 6), - Text( - '访问:${item.authorName}', - style: const TextStyle(fontSize: 13), - ) - ], - ), - ), - if (item.history.business != 'pgc' && - item.badge != '番剧' && - item.tagName?.contains('动画') != true && - item.history.business != 'live' && - item.history.business?.contains('article') != true) - PopupMenuItem( - onTap: () async { - var res = - await UserHttp.toViewLater(bvid: item.history.bvid); - SmartDialog.showToast(res['msg']); + ], + ); }, - height: 35, - child: const Row( - children: [ - Icon(Icons.watch_later_outlined, size: 16), - SizedBox(width: 6), - Text('稍后再看', style: TextStyle(fontSize: 13)) - ], - ), - ), - PopupMenuItem( - onTap: () => onDelete(item.kid, item.history.business), - height: 35, - child: const Row( - children: [ - Icon(Icons.close_outlined, size: 16), - SizedBox(width: 6), - Text('删除记录', style: TextStyle(fontSize: 13)) - ], ), ), + const SizedBox(width: 10), + content(theme), ], ), ), - ), - ], + Positioned( + right: 12, + bottom: 0, + child: SizedBox( + width: 29, + height: 29, + child: PopupMenuButton( + padding: EdgeInsets.zero, + tooltip: '功能菜单', + icon: Icon( + Icons.more_vert_outlined, + color: theme.colorScheme.outline, + size: 18, + ), + position: PopupMenuPosition.under, + itemBuilder: (BuildContext context) => + >[ + if (item.authorMid != null && + item.authorName?.isNotEmpty == true) + PopupMenuItem( + onTap: () => + Get.toNamed('/member?mid=${item.authorMid}'), + height: 35, + child: Row( + children: [ + const Icon(MdiIcons.accountCircleOutline, size: 16), + const SizedBox(width: 6), + Text( + '访问:${item.authorName}', + style: const TextStyle(fontSize: 13), + ) + ], + ), + ), + if (item.history.business != 'pgc' && + item.badge != '番剧' && + item.tagName?.contains('动画') != true && + item.history.business != 'live' && + item.history.business?.contains('article') != true) + PopupMenuItem( + onTap: () async { + var res = await UserHttp.toViewLater( + bvid: item.history.bvid); + SmartDialog.showToast(res['msg']); + }, + height: 35, + child: const Row( + children: [ + Icon(Icons.watch_later_outlined, size: 16), + SizedBox(width: 6), + Text('稍后再看', style: TextStyle(fontSize: 13)) + ], + ), + ), + PopupMenuItem( + onTap: () => onDelete(item.kid, item.history.business), + 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/home/view.dart b/lib/pages/home/view.dart index 0a43eebf..c4e7725b 100644 --- a/lib/pages/home/view.dart +++ b/lib/pages/home/view.dart @@ -39,24 +39,29 @@ class _HomePageState extends State if (_homeController.tabs.length > 1) Material( color: theme.colorScheme.surface, - child: Container( - height: 42, + child: Padding( padding: const EdgeInsets.only(top: 4), - child: TabBar( - controller: _homeController.tabController, - tabs: [for (var i in _homeController.tabs) Tab(text: i.label)], - isScrollable: true, - dividerColor: Colors.transparent, - dividerHeight: 0, - enableFeedback: true, - splashBorderRadius: StyleString.mdRadius, - tabAlignment: TabAlignment.center, - onTap: (value) { - feedBack(); - if (!_homeController.tabController.indexIsChanging) { - _homeController.animateToTop(); - } - }, + child: SizedBox( + height: 42, + width: double.infinity, + child: TabBar( + controller: _homeController.tabController, + tabs: [ + for (var i in _homeController.tabs) Tab(text: i.label) + ], + isScrollable: true, + dividerColor: Colors.transparent, + dividerHeight: 0, + enableFeedback: true, + splashBorderRadius: StyleString.mdRadius, + tabAlignment: TabAlignment.center, + onTap: (value) { + feedBack(); + if (!_homeController.tabController.indexIsChanging) { + _homeController.animateToTop(); + } + }, + ), ), ), ) @@ -98,7 +103,7 @@ class _HomePageState extends State ), Positioned.fill( child: Material( - color: Colors.transparent, + type: MaterialType.transparency, child: InkWell( onTap: () => _homeController.showUserInfoDialog(context), @@ -170,15 +175,13 @@ class _HomePageState extends State Widget searchBar(ThemeData theme) { return Expanded( - child: Container( + child: SizedBox( height: 44, - clipBehavior: Clip.hardEdge, - decoration: const BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(25)), - ), child: Material( + borderRadius: const BorderRadius.all(Radius.circular(25)), color: theme.colorScheme.onSecondaryContainer.withValues(alpha: 0.05), child: InkWell( + borderRadius: const BorderRadius.all(Radius.circular(25)), splashColor: theme.colorScheme.primaryContainer.withValues(alpha: 0.3), onTap: () => Get.toNamed( diff --git a/lib/pages/later/view.dart b/lib/pages/later/view.dart index 1238f8db..4883207e 100644 --- a/lib/pages/later/view.dart +++ b/lib/pages/later/view.dart @@ -147,7 +147,7 @@ class _LaterPageState extends State ), Material( clipBehavior: Clip.hardEdge, - color: Colors.transparent, + type: MaterialType.transparency, borderRadius: const BorderRadius.all(Radius.circular(20)), child: Builder( key: sortKey, @@ -198,7 +198,7 @@ class _LaterPageState extends State ), Material( clipBehavior: Clip.hardEdge, - color: Colors.transparent, + type: MaterialType.transparency, borderRadius: const BorderRadius.all(Radius.circular(20)), child: PopupMenuButton( tooltip: '清空', diff --git a/lib/pages/later/widgets/video_card_h_later.dart b/lib/pages/later/widgets/video_card_h_later.dart index 0865617f..e3c479aa 100644 --- a/lib/pages/later/widgets/video_card_h_later.dart +++ b/lib/pages/later/widgets/video_card_h_later.dart @@ -38,7 +38,7 @@ class VideoCardHLater extends StatelessWidget { } } return Material( - color: Colors.transparent, + type: MaterialType.transparency, child: InkWell( onLongPress: onLongPress ?? () => imageSaveDialog( diff --git a/lib/pages/live/view.dart b/lib/pages/live/view.dart index ce290f06..8ac0a1cd 100644 --- a/lib/pages/live/view.dart +++ b/lib/pages/live/view.dart @@ -41,8 +41,7 @@ class _LivePageState extends CommonPageState final ThemeData theme = Theme.of(context); return Container( clipBehavior: Clip.hardEdge, - margin: const EdgeInsets.only( - left: StyleString.safeSpace, right: StyleString.safeSpace), + margin: const EdgeInsets.symmetric(horizontal: StyleString.safeSpace), decoration: const BoxDecoration(borderRadius: StyleString.mdRadius), child: refreshIndicator( onRefresh: controller.onRefresh, diff --git a/lib/pages/live/widgets/live_item_app.dart b/lib/pages/live/widgets/live_item_app.dart index 7cdc998f..9e114bee 100644 --- a/lib/pages/live/widgets/live_item_app.dart +++ b/lib/pages/live/widgets/live_item_app.dart @@ -17,10 +17,8 @@ class LiveCardVApp extends StatelessWidget { @override Widget build(BuildContext context) { - String heroTag = Utils.makeHeroTag(item.roomid); return Card( clipBehavior: Clip.hardEdge, - margin: EdgeInsets.zero, child: InkWell( onTap: () => Get.toNamed('/liveRoom?roomid=${item.roomid}'), onLongPress: () => imageSaveDialog( @@ -37,13 +35,11 @@ class LiveCardVApp extends StatelessWidget { return Stack( clipBehavior: Clip.none, children: [ - Hero( - tag: heroTag, - child: NetworkImgLayer( - src: item.cover!, - width: maxWidth, - height: maxHeight, - ), + NetworkImgLayer( + src: item.cover!, + width: maxWidth, + height: maxHeight, + radius: 0, ), Positioned( left: 0, diff --git a/lib/pages/live_emote/view.dart b/lib/pages/live_emote/view.dart index 475119d8..e57884cb 100644 --- a/lib/pages/live_emote/view.dart +++ b/lib/pages/live_emote/view.dart @@ -74,7 +74,7 @@ class _LiveEmotePanelState extends State itemCount: item.emoticons!.length, itemBuilder: (context, index) { return Material( - color: Colors.transparent, + type: MaterialType.transparency, child: InkWell( borderRadius: const BorderRadius.all(Radius.circular(8)), diff --git a/lib/pages/live_follow/widgets/live_item_follow.dart b/lib/pages/live_follow/widgets/live_item_follow.dart index 789329e8..decc500b 100644 --- a/lib/pages/live_follow/widgets/live_item_follow.dart +++ b/lib/pages/live_follow/widgets/live_item_follow.dart @@ -2,7 +2,6 @@ import 'package:PiliPlus/common/constants.dart'; import 'package:PiliPlus/common/widgets/image/image_save.dart'; import 'package:PiliPlus/common/widgets/image/network_img_layer.dart'; import 'package:PiliPlus/models_new/live/live_follow/item.dart'; -import 'package:PiliPlus/utils/utils.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; @@ -17,10 +16,8 @@ class LiveCardVFollow extends StatelessWidget { @override Widget build(BuildContext context) { - String heroTag = Utils.makeHeroTag(liveItem.roomid); return Card( clipBehavior: Clip.hardEdge, - margin: EdgeInsets.zero, child: InkWell( onTap: () => Get.toNamed('/liveRoom?roomid=${liveItem.roomid}'), onLongPress: () => imageSaveDialog( @@ -37,13 +34,11 @@ class LiveCardVFollow extends StatelessWidget { return Stack( clipBehavior: Clip.none, children: [ - Hero( - tag: heroTag, - child: NetworkImgLayer( - src: liveItem.roomCover!, - width: maxWidth, - height: maxHeight, - ), + NetworkImgLayer( + src: liveItem.roomCover!, + width: maxWidth, + height: maxHeight, + radius: 0, ), Positioned( left: 0, diff --git a/lib/pages/live_room/widgets/chat.dart b/lib/pages/live_room/widgets/chat.dart index 763034a1..e9477bb5 100644 --- a/lib/pages/live_room/widgets/chat.dart +++ b/lib/pages/live_room/widgets/chat.dart @@ -1,7 +1,6 @@ import 'package:PiliPlus/common/widgets/image/network_img_layer.dart'; import 'package:PiliPlus/models/common/image_type.dart'; import 'package:PiliPlus/pages/live_room/controller.dart'; -import 'package:PiliPlus/utils/utils.dart'; import 'package:flutter/foundation.dart' show kDebugMode; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; @@ -58,14 +57,8 @@ class LiveRoomChat extends StatelessWidget { recognizer: TapGestureRecognizer() ..onTap = () { try { - dynamic uid = - liveRoomController.messages[index]['uid']; Get.toNamed( - '/member?mid=$uid', - arguments: { - 'heroTag': Utils.makeHeroTag(uid), - }, - ); + '/member?mid=${liveRoomController.messages[index]['uid']}'); } catch (err) { if (kDebugMode) debugPrint(err.toString()); } diff --git a/lib/pages/live_search/view.dart b/lib/pages/live_search/view.dart index 06e2d834..1c78187c 100644 --- a/lib/pages/live_search/view.dart +++ b/lib/pages/live_search/view.dart @@ -88,21 +88,18 @@ class _LiveSearchPageState extends State { }, ), Expanded( - child: Material( - color: Colors.transparent, - child: tabBarView( - controller: _controller.tabController, - children: [ - LiveSearchChildPage( - controller: _controller.roomCtr, - searchType: LiveSearchType.room, - ), - LiveSearchChildPage( - controller: _controller.userCtr, - searchType: LiveSearchType.user, - ), - ], - ), + child: tabBarView( + controller: _controller.tabController, + children: [ + LiveSearchChildPage( + controller: _controller.roomCtr, + searchType: LiveSearchType.room, + ), + LiveSearchChildPage( + controller: _controller.userCtr, + searchType: LiveSearchType.user, + ), + ], ), ), ], diff --git a/lib/pages/live_search/widgets/live_search_room.dart b/lib/pages/live_search/widgets/live_search_room.dart index 8863d9c4..c41363ea 100644 --- a/lib/pages/live_search/widgets/live_search_room.dart +++ b/lib/pages/live_search/widgets/live_search_room.dart @@ -17,10 +17,8 @@ class LiveCardVSearch extends StatelessWidget { @override Widget build(BuildContext context) { - String heroTag = Utils.makeHeroTag(item.roomid); return Card( clipBehavior: Clip.hardEdge, - margin: EdgeInsets.zero, child: InkWell( onTap: () => Get.toNamed('/liveRoom?roomid=${item.roomid}'), onLongPress: () => imageSaveDialog( @@ -38,13 +36,11 @@ class LiveCardVSearch extends StatelessWidget { return Stack( clipBehavior: Clip.none, children: [ - Hero( - tag: heroTag, - child: NetworkImgLayer( - src: item.cover!, - width: maxWidth, - height: maxHeight, - ), + NetworkImgLayer( + src: item.cover!, + width: maxWidth, + height: maxHeight, + radius: 0, ), Positioned( left: 0, diff --git a/lib/pages/live_search/widgets/live_search_user.dart b/lib/pages/live_search/widgets/live_search_user.dart index 8ed0ca9c..42531117 100644 --- a/lib/pages/live_search/widgets/live_search_user.dart +++ b/lib/pages/live_search/widgets/live_search_user.dart @@ -20,47 +20,50 @@ class LiveSearchUserItem extends StatelessWidget { fontSize: 13, color: theme.colorScheme.outline, ); - return InkWell( - onTap: () => Get.toNamed( - '/liveRoom?roomid=${item.roomid}', - ), - child: Row( - children: [ - const SizedBox(width: 15), - NetworkImgLayer( - src: item.face, - width: 42, - height: 42, - type: ImageType.avatar, - ), - const SizedBox(width: 10), - Column( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Row( - children: [ - Text( - item.name!, - style: const TextStyle( - fontSize: 14, + return Material( + type: MaterialType.transparency, + child: InkWell( + onTap: () => Get.toNamed( + '/liveRoom?roomid=${item.roomid}', + ), + child: Row( + children: [ + const SizedBox(width: 15), + NetworkImgLayer( + src: item.face, + width: 42, + height: 42, + type: ImageType.avatar, + ), + const SizedBox(width: 10), + Column( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + children: [ + Text( + item.name!, + style: const TextStyle( + fontSize: 14, + ), ), - ), - if (item.liveStatus == 1) ...[ - const SizedBox(width: 10), - Image.asset(height: 14, 'assets/images/live/live.gif'), + if (item.liveStatus == 1) ...[ + const SizedBox(width: 10), + Image.asset(height: 14, 'assets/images/live/live.gif'), + ], ], - ], - ), - const SizedBox(height: 2), - Text( - '分区: ${item.areaName ?? ''} 关注数: ${Utils.numFormat(item.fansNum ?? 0)}', - style: style, - ), - ], - ) - ], + ), + const SizedBox(height: 2), + Text( + '分区: ${item.areaName ?? ''} 关注数: ${Utils.numFormat(item.fansNum ?? 0)}', + style: style, + ), + ], + ) + ], + ), ), ); } diff --git a/lib/pages/main/view.dart b/lib/pages/main/view.dart index 0b7cec3b..709fd073 100644 --- a/lib/pages/main/view.dart +++ b/lib/pages/main/view.dart @@ -399,7 +399,7 @@ class _MainAppState extends State ), Positioned.fill( child: Material( - color: Colors.transparent, + type: MaterialType.transparency, child: InkWell( onTap: () => _homeController.showUserInfoDialog(context), diff --git a/lib/pages/media/view.dart b/lib/pages/media/view.dart index d74ca3e7..9c31f13a 100644 --- a/lib/pages/media/view.dart +++ b/lib/pages/media/view.dart @@ -45,7 +45,7 @@ class _MediaPageState extends CommonPageState return Padding( padding: const EdgeInsets.only(top: 30), child: Material( - color: Colors.transparent, + type: MaterialType.transparency, child: ListView( controller: controller.scrollController, physics: const AlwaysScrollableScrollPhysics(), diff --git a/lib/pages/media/widgets/item.dart b/lib/pages/media/widgets/item.dart index 5c1c7b2b..d5f0debe 100644 --- a/lib/pages/media/widgets/item.dart +++ b/lib/pages/media/widgets/item.dart @@ -42,11 +42,8 @@ class FavFolderItem extends StatelessWidget { width: 180, height: 110, margin: const EdgeInsets.only(bottom: 8), - clipBehavior: Clip.hardEdge, decoration: BoxDecoration( borderRadius: const BorderRadius.all(Radius.circular(12)), - color: - theme.colorScheme.onInverseSurface.withValues(alpha: 0.4), boxShadow: [ BoxShadow( color: theme.colorScheme.onInverseSurface @@ -58,7 +55,7 @@ class FavFolderItem extends StatelessWidget { ], ), child: LayoutBuilder( - builder: (context, BoxConstraints box) { + builder: (context, box) { return Hero( tag: heroTag, child: NetworkImgLayer( diff --git a/lib/pages/member_article/widget/item.dart b/lib/pages/member_article/widget/item.dart index 5d74ecd4..9ff905af 100644 --- a/lib/pages/member_article/widget/item.dart +++ b/lib/pages/member_article/widget/item.dart @@ -17,7 +17,7 @@ class MemberArticleItem extends StatelessWidget { final theme = Theme.of(context); final outline = theme.colorScheme.outline; return Material( - color: Colors.transparent, + type: MaterialType.transparency, child: InkWell( onTap: () { if (item.uri?.isNotEmpty == true) { diff --git a/lib/pages/member_coin_arc/widgets/item.dart b/lib/pages/member_coin_arc/widgets/item.dart index 92833fb8..dfae1920 100644 --- a/lib/pages/member_coin_arc/widgets/item.dart +++ b/lib/pages/member_coin_arc/widgets/item.dart @@ -24,7 +24,6 @@ class MemberCoinLikeItem extends StatelessWidget { Widget build(BuildContext context) { return Card( clipBehavior: Clip.hardEdge, - margin: EdgeInsets.zero, child: InkWell( onTap: () async { if (item.isPgc == true) { @@ -67,6 +66,7 @@ class MemberCoinLikeItem extends StatelessWidget { src: item.cover, width: maxWidth, height: maxHeight, + radius: 0, ), if (item.duration != null && item.duration! > 0) PBadge( diff --git a/lib/pages/member_contribute/view.dart b/lib/pages/member_contribute/view.dart index feb235ff..109fcc38 100644 --- a/lib/pages/member_contribute/view.dart +++ b/lib/pages/member_contribute/view.dart @@ -73,13 +73,10 @@ class _MemberContributeState extends State ), ), Expanded( - child: Material( - color: Colors.transparent, - child: TabBarView( - physics: const NeverScrollableScrollPhysics(), - controller: _controller.tabController, - children: _controller.items!.map(_getPageFromType).toList(), - ), + child: TabBarView( + physics: const NeverScrollableScrollPhysics(), + controller: _controller.tabController, + children: _controller.items!.map(_getPageFromType).toList(), ), ), ], diff --git a/lib/pages/member_favorite/widget/item.dart b/lib/pages/member_favorite/widget/item.dart index 842b8db8..1798b2fc 100644 --- a/lib/pages/member_favorite/widget/item.dart +++ b/lib/pages/member_favorite/widget/item.dart @@ -18,7 +18,7 @@ class MemberFavItem extends StatelessWidget { Widget build(BuildContext context) { final theme = Theme.of(context); return Material( - color: Colors.transparent, + type: MaterialType.transparency, child: InkWell( onTap: () async { if (item.state == 1) { diff --git a/lib/pages/member_home/widgets/fav_item.dart b/lib/pages/member_home/widgets/fav_item.dart index ff259c34..31034f49 100644 --- a/lib/pages/member_home/widgets/fav_item.dart +++ b/lib/pages/member_home/widgets/fav_item.dart @@ -14,7 +14,7 @@ class MemberFavItem extends StatelessWidget { @override Widget build(BuildContext context) { return Material( - color: Colors.transparent, + type: MaterialType.transparency, child: InkWell( onTap: () { if (item.type == 2) { diff --git a/lib/pages/member_home/widgets/video_card_v_member_home.dart b/lib/pages/member_home/widgets/video_card_v_member_home.dart index eee9a32c..cad79850 100644 --- a/lib/pages/member_home/widgets/video_card_v_member_home.dart +++ b/lib/pages/member_home/widgets/video_card_v_member_home.dart @@ -65,7 +65,6 @@ class VideoCardVMemberHome extends StatelessWidget { Widget build(BuildContext context) { return Card( clipBehavior: Clip.hardEdge, - margin: EdgeInsets.zero, child: InkWell( onTap: () => onPushDetail(Utils.makeHeroTag(videoItem.bvid)), onLongPress: () => imageSaveDialog( @@ -90,6 +89,7 @@ class VideoCardVMemberHome extends StatelessWidget { src: videoItem.cover, width: maxWidth, height: maxHeight, + radius: 0, ), if (videoItem.duration > 0) PBadge( diff --git a/lib/pages/member_opus/widgets/space_opus_item.dart b/lib/pages/member_opus/widgets/space_opus_item.dart index acf64a9e..404da39a 100644 --- a/lib/pages/member_opus/widgets/space_opus_item.dart +++ b/lib/pages/member_opus/widgets/space_opus_item.dart @@ -19,7 +19,6 @@ class SpaceOpusItem extends StatelessWidget { final hasPic = item.cover?.url?.isNotEmpty == true; return Card( clipBehavior: Clip.hardEdge, - margin: EdgeInsets.zero, shape: const RoundedRectangleBorder( borderRadius: BorderRadius.all(Radius.circular(6)), ), diff --git a/lib/pages/member_pgc/widgets/pgc_card_v_member_pgc.dart b/lib/pages/member_pgc/widgets/pgc_card_v_member_pgc.dart index a9f0f512..ffe42e70 100644 --- a/lib/pages/member_pgc/widgets/pgc_card_v_member_pgc.dart +++ b/lib/pages/member_pgc/widgets/pgc_card_v_member_pgc.dart @@ -1,8 +1,8 @@ +import 'package:PiliPlus/common/constants.dart'; import 'package:PiliPlus/common/widgets/image/image_save.dart'; import 'package:PiliPlus/common/widgets/image/network_img_layer.dart'; import 'package:PiliPlus/models_new/space/space_archive/item.dart'; import 'package:PiliPlus/utils/page_utils.dart'; -import 'package:PiliPlus/utils/utils.dart'; import 'package:flutter/material.dart'; // 视频卡片 - 垂直布局 @@ -16,11 +16,10 @@ class PgcCardVMemberPgc extends StatelessWidget { @override Widget build(BuildContext context) { - String heroTag = Utils.makeHeroTag(item.param); return Card( - clipBehavior: Clip.hardEdge, - margin: EdgeInsets.zero, + shape: const RoundedRectangleBorder(borderRadius: StyleString.mdRadius), child: InkWell( + borderRadius: StyleString.mdRadius, onTap: () => PageUtils.viewPgc(seasonId: item.param), onLongPress: () => imageSaveDialog( title: item.title, @@ -32,13 +31,10 @@ class PgcCardVMemberPgc extends StatelessWidget { AspectRatio( aspectRatio: 0.75, child: LayoutBuilder(builder: (context, boxConstraints) { - return Hero( - tag: heroTag, - child: NetworkImgLayer( - src: item.cover, - width: boxConstraints.maxWidth, - height: boxConstraints.maxHeight, - ), + return NetworkImgLayer( + src: item.cover, + width: boxConstraints.maxWidth, + height: boxConstraints.maxHeight, ); }), ), diff --git a/lib/pages/member_season_series/widget/season_series_card.dart b/lib/pages/member_season_series/widget/season_series_card.dart index 90841a1b..233e1b2e 100644 --- a/lib/pages/member_season_series/widget/season_series_card.dart +++ b/lib/pages/member_season_series/widget/season_series_card.dart @@ -17,49 +17,53 @@ class SeasonSeriesCard extends StatelessWidget { @override Widget build(BuildContext context) { - return InkWell( - onLongPress: () => imageSaveDialog( - title: item.meta!.name, - cover: item.meta!.cover, - ), - onTap: onTap, - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: StyleString.safeSpace, - vertical: 5, + return Material( + type: MaterialType.transparency, + child: InkWell( + onLongPress: () => imageSaveDialog( + title: item.meta!.name, + cover: item.meta!.cover, ), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AspectRatio( - aspectRatio: StyleString.aspectRatio, - child: LayoutBuilder( - builder: (BuildContext context, BoxConstraints boxConstraints) { - final double maxWidth = boxConstraints.maxWidth; - final double maxHeight = boxConstraints.maxHeight; - return Stack( - clipBehavior: Clip.none, - children: [ - NetworkImgLayer( - src: item.meta!.cover, - width: maxWidth, - height: maxHeight, - ), - PBadge( - text: - '${item.meta!.seasonId != null ? '合集' : '列表'}: ${item.meta!.total}', - bottom: 6.0, - right: 6.0, - ), - ], - ); - }, + onTap: onTap, + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: StyleString.safeSpace, + vertical: 5, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AspectRatio( + aspectRatio: StyleString.aspectRatio, + child: LayoutBuilder( + builder: + (BuildContext context, BoxConstraints boxConstraints) { + final double maxWidth = boxConstraints.maxWidth; + final double maxHeight = boxConstraints.maxHeight; + return Stack( + clipBehavior: Clip.none, + children: [ + NetworkImgLayer( + src: item.meta!.cover, + width: maxWidth, + height: maxHeight, + ), + PBadge( + text: + '${item.meta!.seasonId != null ? '合集' : '列表'}: ${item.meta!.total}', + bottom: 6.0, + right: 6.0, + ), + ], + ); + }, + ), ), - ), - const SizedBox(width: 10), - content(context), - ], + const SizedBox(width: 10), + content(context), + ], + ), ), ), ); diff --git a/lib/pages/member_upower_rank/view.dart b/lib/pages/member_upower_rank/view.dart index 208a8f95..b554e065 100644 --- a/lib/pages/member_upower_rank/view.dart +++ b/lib/pages/member_upower_rank/view.dart @@ -109,22 +109,18 @@ class _UpowerRankPageState extends State }, ), Expanded( - child: Material( - color: Colors.transparent, - child: tabBarView( - children: [ - KeepAliveWrapper( - builder: (context) => child), - ..._controller.tabs.value! - .sublist(1) - .map((e) => UpowerRankPage( - upMid: _upMid, - tag: _tag, - privilegeType: - e.privilegeType, - )) - ], - ), + child: tabBarView( + children: [ + KeepAliveWrapper( + builder: (context) => child), + ..._controller.tabs.value! + .sublist(1) + .map((e) => UpowerRankPage( + upMid: _upMid, + tag: _tag, + privilegeType: e.privilegeType, + )) + ], ), ), ], @@ -164,58 +160,61 @@ class _UpowerRankPageState extends State _controller.onLoadMore(); } final item = response[index]; - return ListTile( - onTap: () => Get.toNamed('/member?mid=${item.mid}'), - leading: SizedBox( - width: width, - child: Center( - child: Text( - (index + 1).toString(), - style: TextStyle( - fontSize: 16, - fontStyle: FontStyle.italic, - fontWeight: FontWeight.bold, - color: switch (index) { - 0 => const Color(0xFFfdad13), - 1 => const Color(0xFF8aace1), - 2 => const Color(0xFFdfa777), - _ => theme.colorScheme.outline, - }, + return Material( + type: MaterialType.transparency, + child: ListTile( + onTap: () => Get.toNamed('/member?mid=${item.mid}'), + leading: SizedBox( + width: width, + child: Center( + child: Text( + (index + 1).toString(), + style: TextStyle( + fontSize: 16, + fontStyle: FontStyle.italic, + fontWeight: FontWeight.bold, + color: switch (index) { + 0 => const Color(0xFFfdad13), + 1 => const Color(0xFF8aace1), + 2 => const Color(0xFFdfa777), + _ => theme.colorScheme.outline, + }, + ), ), ), ), - ), - title: Row( - spacing: 12, - children: [ - NetworkImgLayer( - width: 38, - height: 38, - src: item.avatar, - type: ImageType.avatar, - ), - Text( - item.nickname!, - style: const TextStyle(fontSize: 14), - ), - ], - ), - trailing: Text.rich( - TextSpan( + title: Row( + spacing: 12, children: [ - TextSpan( - text: item.day!.toString(), - style: const TextStyle( - fontSize: 14, - fontWeight: FontWeight.bold, - ), + NetworkImgLayer( + width: 38, + height: 38, + src: item.avatar, + type: ImageType.avatar, ), - const TextSpan( - text: ' 天', - style: TextStyle(fontSize: 13), + Text( + item.nickname!, + style: const TextStyle(fontSize: 14), ), ], ), + trailing: Text.rich( + TextSpan( + children: [ + TextSpan( + text: item.day!.toString(), + style: const TextStyle( + fontSize: 14, + fontWeight: FontWeight.bold, + ), + ), + const TextSpan( + text: ' 天', + style: TextStyle(fontSize: 13), + ), + ], + ), + ), ), ); }, diff --git a/lib/pages/member_video/view.dart b/lib/pages/member_video/view.dart index 8bdefada..95b0f772 100644 --- a/lib/pages/member_video/view.dart +++ b/lib/pages/member_video/view.dart @@ -213,10 +213,8 @@ class _MemberVideoState extends State index == response.length - 1) { _controller.onLoadMore(); } - final SpaceArchiveItem item = response[index]; return VideoCardHMemberVideo( - // key: ValueKey('${item.param}'), - videoItem: item, + videoItem: response[index], fromViewAid: _controller.fromViewAid, ); }, diff --git a/lib/pages/member_video/widgets/video_card_h_member_video.dart b/lib/pages/member_video/widgets/video_card_h_member_video.dart index ab19ef6e..65f46b5d 100644 --- a/lib/pages/member_video/widgets/video_card_h_member_video.dart +++ b/lib/pages/member_video/widgets/video_card_h_member_video.dart @@ -30,160 +30,163 @@ class VideoCardHMemberVideo extends StatelessWidget { @override Widget build(BuildContext context) { final theme = Theme.of(context); - return Stack( - clipBehavior: Clip.none, - children: [ - InkWell( - onLongPress: () => imageSaveDialog( - title: videoItem.title, - cover: videoItem.cover, - bvid: videoItem.bvid, - ), - onTap: onTap ?? - () async { - if (videoItem.isPgc == true && - videoItem.uri?.isNotEmpty == true) { - if (PageUtils.viewPgcFromUri(videoItem.uri!)) { + return Material( + type: MaterialType.transparency, + child: Stack( + clipBehavior: Clip.none, + children: [ + InkWell( + onLongPress: () => imageSaveDialog( + title: videoItem.title, + cover: videoItem.cover, + bvid: videoItem.bvid, + ), + onTap: onTap ?? + () async { + if (videoItem.isPgc == true && + videoItem.uri?.isNotEmpty == true) { + if (PageUtils.viewPgcFromUri(videoItem.uri!)) { + return; + } + } + if (videoItem.bvid == null || videoItem.cid == null) { return; } - } - if (videoItem.bvid == null || videoItem.cid == null) { - return; - } - try { - PageUtils.toVideoPage( - 'bvid=${videoItem.bvid}&cid=${videoItem.cid}', - arguments: { - 'heroTag': Utils.makeHeroTag(videoItem.bvid), - }, - ); - } catch (err) { - SmartDialog.showToast(err.toString()); - } - }, - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: StyleString.safeSpace, - vertical: 5, - ), - child: LayoutBuilder( - builder: (BuildContext context, BoxConstraints boxConstraints) { - return Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AspectRatio( - aspectRatio: StyleString.aspectRatio, - child: LayoutBuilder( - builder: (BuildContext context, - BoxConstraints boxConstraints) { - final double maxWidth = boxConstraints.maxWidth; - final double maxHeight = boxConstraints.maxHeight; - return Stack( - clipBehavior: Clip.none, - children: [ - NetworkImgLayer( - src: videoItem.cover, - width: maxWidth, - height: maxHeight, - ), - if (fromViewAid == videoItem.param) - const Positioned.fill( - child: DecoratedBox( - decoration: BoxDecoration( - borderRadius: StyleString.mdRadius, - color: Colors.black54, - ), - child: Center( - child: Text( - '上次观看', - style: TextStyle( - color: Colors.white, - fontSize: 15, - letterSpacing: 5, + try { + PageUtils.toVideoPage( + 'bvid=${videoItem.bvid}&cid=${videoItem.cid}', + arguments: { + 'heroTag': Utils.makeHeroTag(videoItem.bvid), + }, + ); + } catch (err) { + SmartDialog.showToast(err.toString()); + } + }, + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: StyleString.safeSpace, + vertical: 5, + ), + child: LayoutBuilder( + builder: (BuildContext context, BoxConstraints boxConstraints) { + return Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AspectRatio( + aspectRatio: StyleString.aspectRatio, + child: LayoutBuilder( + builder: (BuildContext context, + BoxConstraints boxConstraints) { + final double maxWidth = boxConstraints.maxWidth; + final double maxHeight = boxConstraints.maxHeight; + return Stack( + clipBehavior: Clip.none, + children: [ + NetworkImgLayer( + src: videoItem.cover, + width: maxWidth, + height: maxHeight, + ), + if (fromViewAid == videoItem.param) + const Positioned.fill( + child: DecoratedBox( + decoration: BoxDecoration( + borderRadius: StyleString.mdRadius, + color: Colors.black54, + ), + child: Center( + child: Text( + '上次观看', + style: TextStyle( + color: Colors.white, + fontSize: 15, + letterSpacing: 5, + ), ), ), ), ), - ), - if (videoItem.badges?.isNotEmpty == true) - PBadge( - text: videoItem.badges! - .map((item) => item.text) - .join('|'), - right: 6.0, - top: 6.0, - type: videoItem.badges!.first.text == '充电专属' - ? PBadgeType.error - : PBadgeType.primary, - ), - if (videoItem.history != null) ...[ - Builder(builder: (context) { - try { - return Positioned( - left: 0, - right: 0, - bottom: 0, - child: videoProgressIndicator( - videoItem.history!.progress! / - videoItem.history!.duration!, - ), - ); - } catch (_) { - return const SizedBox.shrink(); - } - }), - Builder(builder: (context) { - try { - return PBadge( - text: videoItem.history!.progress == - videoItem.history!.duration - ? '已看完' - : '${Utils.timeFormat(videoItem.history!.progress)}/${Utils.timeFormat(videoItem.history!.duration)}', - right: 6.0, - bottom: 6.0, - type: PBadgeType.gray, - ); - } catch (_) { - return PBadge( - text: - Utils.timeFormat(videoItem.duration), - right: 6.0, - bottom: 6.0, - type: PBadgeType.gray, - ); - } - }), - ] else if (videoItem.duration > 0) - PBadge( - text: Utils.timeFormat(videoItem.duration), - right: 6.0, - bottom: 6.0, - type: PBadgeType.gray, - ), - ], - ); - }, + if (videoItem.badges?.isNotEmpty == true) + PBadge( + text: videoItem.badges! + .map((item) => item.text) + .join('|'), + right: 6.0, + top: 6.0, + type: videoItem.badges!.first.text == '充电专属' + ? PBadgeType.error + : PBadgeType.primary, + ), + if (videoItem.history != null) ...[ + Builder(builder: (context) { + try { + return Positioned( + left: 0, + right: 0, + bottom: 0, + child: videoProgressIndicator( + videoItem.history!.progress! / + videoItem.history!.duration!, + ), + ); + } catch (_) { + return const SizedBox.shrink(); + } + }), + Builder(builder: (context) { + try { + return PBadge( + text: videoItem.history!.progress == + videoItem.history!.duration + ? '已看完' + : '${Utils.timeFormat(videoItem.history!.progress)}/${Utils.timeFormat(videoItem.history!.duration)}', + right: 6.0, + bottom: 6.0, + type: PBadgeType.gray, + ); + } catch (_) { + return PBadge( + text: Utils.timeFormat( + videoItem.duration), + right: 6.0, + bottom: 6.0, + type: PBadgeType.gray, + ); + } + }), + ] else if (videoItem.duration > 0) + PBadge( + text: Utils.timeFormat(videoItem.duration), + right: 6.0, + bottom: 6.0, + type: PBadgeType.gray, + ), + ], + ); + }, + ), ), - ), - const SizedBox(width: 10), - content(context, theme), - ], - ); - }, + const SizedBox(width: 10), + content(context, theme), + ], + ); + }, + ), ), ), - ), - Positioned( - bottom: 0, - right: 12, - child: VideoPopupMenu( - size: 29, - iconSize: 17, - videoItem: videoItem, + Positioned( + bottom: 0, + right: 12, + child: VideoPopupMenu( + size: 29, + iconSize: 17, + videoItem: videoItem, + ), ), - ), - ], + ], + ), ); } diff --git a/lib/pages/mine/controller.dart b/lib/pages/mine/controller.dart index d84e253d..3393cc75 100644 --- a/lib/pages/mine/controller.dart +++ b/lib/pages/mine/controller.dart @@ -42,10 +42,8 @@ class MineController extends GetxController { if (!accountService.isLogin.value || longPress) { Get.toNamed('/loginPage', preventDuplicates: false); } else { - int mid = userInfo.value.mid!; - String face = userInfo.value.face!; - Get.toNamed('/member?mid=$mid', - arguments: {'face': face}, preventDuplicates: false); + Get.toNamed('/member?mid=${userInfo.value.mid}', + preventDuplicates: false); } } diff --git a/lib/pages/pgc/view.dart b/lib/pages/pgc/view.dart index 19feb55c..6b8f23a3 100644 --- a/lib/pages/pgc/view.dart +++ b/lib/pages/pgc/view.dart @@ -94,50 +94,47 @@ class _PgcPageState extends CommonPageState ), const SizedBox(width: 16), Expanded( - child: Material( - color: Colors.transparent, - child: TabBar( - isScrollable: true, - tabAlignment: TabAlignment.start, - dividerHeight: 0, - overlayColor: - WidgetStateProperty.all(Colors.transparent), - splashFactory: NoSplash.splashFactory, - padding: const EdgeInsets.only(right: 10), - indicatorPadding: const EdgeInsets.symmetric( - horizontal: 4, - vertical: 10, - ), - indicator: BoxDecoration( - color: theme.colorScheme.secondaryContainer, - borderRadius: const BorderRadius.all( - Radius.circular(20)), - ), - indicatorSize: TabBarIndicatorSize.tab, - labelColor: - theme.colorScheme.onSecondaryContainer, - labelStyle: TabBarTheme.of(context) - .labelStyle - ?.copyWith(fontSize: 14) ?? - const TextStyle(fontSize: 14), - dividerColor: Colors.transparent, - tabs: response.map( - (item) { - return Tab( - text: - '${item.date} ${item.isToday == 1 ? '今天' : '周${const [ - '一', - '二', - '三', - '四', - '五', - '六', - '日', - ][item.dayOfWeek! - 1]}'}', - ); - }, - ).toList(), + child: TabBar( + isScrollable: true, + tabAlignment: TabAlignment.start, + dividerHeight: 0, + overlayColor: + WidgetStateProperty.all(Colors.transparent), + splashFactory: NoSplash.splashFactory, + padding: const EdgeInsets.only(right: 10), + indicatorPadding: const EdgeInsets.symmetric( + horizontal: 4, + vertical: 10, ), + indicator: BoxDecoration( + color: theme.colorScheme.secondaryContainer, + borderRadius: + const BorderRadius.all(Radius.circular(20)), + ), + indicatorSize: TabBarIndicatorSize.tab, + labelColor: + theme.colorScheme.onSecondaryContainer, + labelStyle: TabBarTheme.of(context) + .labelStyle + ?.copyWith(fontSize: 14) ?? + const TextStyle(fontSize: 14), + dividerColor: Colors.transparent, + tabs: response.map( + (item) { + return Tab( + text: + '${item.date} ${item.isToday == 1 ? '今天' : '周${const [ + '一', + '二', + '三', + '四', + '五', + '六', + '日', + ][item.dayOfWeek! - 1]}'}', + ); + }, + ).toList(), ), ), ], @@ -237,38 +234,41 @@ class _PgcPageState extends CommonPageState appBar: AppBar(title: const Text('索引')), body: DefaultTabController( length: types.length, - child: Builder(builder: (context) { - return Column( - children: [ - SafeArea( - top: false, - bottom: false, - child: TabBar( - tabs: titles - .map((title) => Tab(text: title)) - .toList(), - onTap: (index) { - try { - if (!DefaultTabController.of(context) - .indexIsChanging) { - Get.find( - tag: types[index].toString()) - .animateToTop(); - } - } catch (_) {} - }, + child: Builder( + builder: (context) { + return Column( + children: [ + SafeArea( + top: false, + bottom: false, + child: TabBar( + tabs: titles + .map((title) => Tab(text: title)) + .toList(), + onTap: (index) { + try { + if (!DefaultTabController.of(context) + .indexIsChanging) { + Get.find( + tag: + types[index].toString()) + .animateToTop(); + } + } catch (_) {} + }, + ), ), - ), - Expanded( - child: tabBarView( - children: types - .map((type) => - PgcIndexPage(indexType: type)) - .toList()), - ) - ], - ); - }), + Expanded( + child: tabBarView( + children: types + .map((type) => + PgcIndexPage(indexType: type)) + .toList()), + ) + ], + ); + }, + ), ), ), ); diff --git a/lib/pages/pgc/widgets/pgc_card_v.dart b/lib/pages/pgc/widgets/pgc_card_v.dart index 0fd102ec..1f605648 100644 --- a/lib/pages/pgc/widgets/pgc_card_v.dart +++ b/lib/pages/pgc/widgets/pgc_card_v.dart @@ -1,10 +1,10 @@ +import 'package:PiliPlus/common/constants.dart'; import 'package:PiliPlus/common/widgets/badge.dart'; import 'package:PiliPlus/common/widgets/image/image_save.dart'; import 'package:PiliPlus/common/widgets/image/network_img_layer.dart'; import 'package:PiliPlus/models/common/badge_type.dart'; import 'package:PiliPlus/models_new/fav/fav_pgc/list.dart'; import 'package:PiliPlus/utils/page_utils.dart'; -import 'package:PiliPlus/utils/utils.dart'; import 'package:flutter/material.dart'; // 视频卡片 - 垂直布局 @@ -18,11 +18,10 @@ class PgcCardV extends StatelessWidget { @override Widget build(BuildContext context) { - String heroTag = Utils.makeHeroTag(item.mediaId); return Card( - clipBehavior: Clip.hardEdge, - margin: EdgeInsets.zero, + shape: const RoundedRectangleBorder(borderRadius: StyleString.mdRadius), child: InkWell( + borderRadius: StyleString.mdRadius, onLongPress: () => imageSaveDialog( title: item.title, cover: item.cover, @@ -39,13 +38,10 @@ class PgcCardV extends StatelessWidget { return Stack( clipBehavior: Clip.none, children: [ - Hero( - tag: heroTag, - child: NetworkImgLayer( - src: item.cover, - width: maxWidth, - height: maxHeight, - ), + NetworkImgLayer( + src: item.cover, + width: maxWidth, + height: maxHeight, ), PBadge( text: item.badge, diff --git a/lib/pages/pgc/widgets/pgc_card_v_timeline.dart b/lib/pages/pgc/widgets/pgc_card_v_timeline.dart index fef2f9df..991048e0 100644 --- a/lib/pages/pgc/widgets/pgc_card_v_timeline.dart +++ b/lib/pages/pgc/widgets/pgc_card_v_timeline.dart @@ -1,3 +1,4 @@ +import 'package:PiliPlus/common/constants.dart'; import 'package:PiliPlus/common/widgets/badge.dart'; import 'package:PiliPlus/common/widgets/image/image_save.dart'; import 'package:PiliPlus/common/widgets/image/network_img_layer.dart'; @@ -18,9 +19,9 @@ class PgcCardVTimeline extends StatelessWidget { @override Widget build(BuildContext context) { return Card( - clipBehavior: Clip.hardEdge, - margin: EdgeInsets.zero, + shape: const RoundedRectangleBorder(borderRadius: StyleString.mdRadius), child: InkWell( + borderRadius: StyleString.mdRadius, onLongPress: () => imageSaveDialog( title: item.title, cover: item.cover, diff --git a/lib/pages/pgc_index/widgets/pgc_card_v_pgc_index.dart b/lib/pages/pgc_index/widgets/pgc_card_v_pgc_index.dart index b76ced61..78a813b6 100644 --- a/lib/pages/pgc_index/widgets/pgc_card_v_pgc_index.dart +++ b/lib/pages/pgc_index/widgets/pgc_card_v_pgc_index.dart @@ -1,3 +1,4 @@ +import 'package:PiliPlus/common/constants.dart'; import 'package:PiliPlus/common/widgets/badge.dart'; import 'package:PiliPlus/common/widgets/image/image_save.dart'; import 'package:PiliPlus/common/widgets/image/network_img_layer.dart'; @@ -18,9 +19,9 @@ class PgcCardVPgcIndex extends StatelessWidget { @override Widget build(BuildContext context) { return Card( - clipBehavior: Clip.hardEdge, - margin: EdgeInsets.zero, + shape: const RoundedRectangleBorder(borderRadius: StyleString.mdRadius), child: InkWell( + borderRadius: StyleString.mdRadius, onLongPress: () => imageSaveDialog( title: item.title, cover: item.cover, diff --git a/lib/pages/pgc_review/child/view.dart b/lib/pages/pgc_review/child/view.dart index f670f607..c129a2af 100644 --- a/lib/pages/pgc_review/child/view.dart +++ b/lib/pages/pgc_review/child/view.dart @@ -108,252 +108,255 @@ class _PgcReviewChildPageState extends State } Widget _itemWidget(ThemeData theme, int index, PgcReviewItemModel item) { - return InkWell( - onTap: isLongReview - ? () => Get.toNamed( - '/articlePage', - parameters: { - 'id': item.articleId!.toString(), - 'type': 'read', - }, - ) - : null, - onLongPress: isLongReview - ? null - : () => showDialog( - context: context, - builder: (context) => AlertDialog( - clipBehavior: Clip.hardEdge, - contentPadding: const EdgeInsets.symmetric(vertical: 12), - content: Column( - mainAxisSize: MainAxisSize.min, - children: [ - if (item.author!.mid == Accounts.main.mid) ...[ - ListTile( - dense: true, - title: const Text( - '编辑', - style: TextStyle(fontSize: 14), - ), - onTap: () { - Get.back(); - showModalBottomSheet( - context: context, - useSafeArea: true, - isScrollControlled: true, - builder: (context) { - return PgcReviewPostPanel( - name: widget.name, - mediaId: widget.mediaId, - reviewId: item.reviewId, - content: item.content, - score: item.score, - ); - }, - ); - }, - ), - ListTile( - dense: true, - title: const Text( - '删除', - style: TextStyle(fontSize: 14), - ), - onTap: () { - Get.back(); - showConfirmDialog( - context: context, - title: '删除短评,同时删除评分?', - onConfirm: () => - _controller.onDel(index, item.reviewId), - ); - }, - ), - ], - ListTile( - dense: true, - title: const Text( - '举报', - style: TextStyle(fontSize: 14), - ), - onTap: () => Get - ..back() - ..toNamed( - '/webview', - parameters: { - 'url': - 'https://www.bilibili.com/appeal/?reviewId=${item.reviewId}&type=shortComment&mediaId=${widget.mediaId}' + return Material( + type: MaterialType.transparency, + child: InkWell( + onTap: isLongReview + ? () => Get.toNamed( + '/articlePage', + parameters: { + 'id': item.articleId!.toString(), + 'type': 'read', + }, + ) + : null, + onLongPress: isLongReview + ? null + : () => showDialog( + context: context, + builder: (context) => AlertDialog( + clipBehavior: Clip.hardEdge, + contentPadding: const EdgeInsets.symmetric(vertical: 12), + content: Column( + mainAxisSize: MainAxisSize.min, + children: [ + if (item.author!.mid == Accounts.main.mid) ...[ + ListTile( + dense: true, + title: const Text( + '编辑', + style: TextStyle(fontSize: 14), + ), + onTap: () { + Get.back(); + showModalBottomSheet( + context: context, + useSafeArea: true, + isScrollControlled: true, + builder: (context) { + return PgcReviewPostPanel( + name: widget.name, + mediaId: widget.mediaId, + reviewId: item.reviewId, + content: item.content, + score: item.score, + ); + }, + ); }, ), - ), - ], - ), - ), - ), - child: Padding( - padding: const EdgeInsets.all(12), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () => Get.toNamed('/member?mid=${item.author!.mid}'), - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - NetworkImgLayer( - height: 34, - width: 34, - src: item.author!.avatar, - type: ImageType.avatar, - ), - const SizedBox(width: 10), - Column( - spacing: 2, - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - spacing: 6, - mainAxisSize: MainAxisSize.min, - children: [ - Text( - item.author!.uname!, - style: TextStyle( - color: item.author?.vip?.status != null && - item.author!.vip!.status > 0 && - item.author!.vip!.type == 2 - ? context.vipColor - : theme.colorScheme.outline, - fontSize: 13, + ListTile( + dense: true, + title: const Text( + '删除', + style: TextStyle(fontSize: 14), ), - ), - Image.asset( - 'assets/images/lv/lv${item.author!.level}.png', - height: 11, - ), - ], - ), - Row( - children: [ - if (item.pushTimeStr != null) ...[ - Text( - item.pushTimeStr!, - style: TextStyle( - color: theme.colorScheme.outline, - fontSize: 12, - ), - ), - const SizedBox(width: 10), - ], - ...List.generate( - 5, - (index) { - if (index <= item.score - 1) { - return const Icon( - CustomIcon.star_favorite_solid, - size: 13, - color: Color(0xFFFFAD35), - ); - } - return const Icon( - CustomIcon.star_favorite_line, - size: 14, - color: Colors.grey, + onTap: () { + Get.back(); + showConfirmDialog( + context: context, + title: '删除短评,同时删除评分?', + onConfirm: () => + _controller.onDel(index, item.reviewId), ); }, ), ], - ) - ], - ) - ], - ), - ), - const SizedBox(height: 5), - if (item.title != null) - Text( - item.title!, - style: const TextStyle( - height: 1.75, - fontSize: 15, - fontWeight: FontWeight.bold, + ListTile( + dense: true, + title: const Text( + '举报', + style: TextStyle(fontSize: 14), + ), + onTap: () => Get + ..back() + ..toNamed( + '/webview', + parameters: { + 'url': + 'https://www.bilibili.com/appeal/?reviewId=${item.reviewId}&type=shortComment&mediaId=${widget.mediaId}' + }, + ), + ), + ], + ), + ), + ), + child: Padding( + padding: const EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () => Get.toNamed('/member?mid=${item.author!.mid}'), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + NetworkImgLayer( + height: 34, + width: 34, + src: item.author!.avatar, + type: ImageType.avatar, + ), + const SizedBox(width: 10), + Column( + spacing: 2, + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + spacing: 6, + mainAxisSize: MainAxisSize.min, + children: [ + Text( + item.author!.uname!, + style: TextStyle( + color: item.author?.vip?.status != null && + item.author!.vip!.status > 0 && + item.author!.vip!.type == 2 + ? context.vipColor + : theme.colorScheme.outline, + fontSize: 13, + ), + ), + Image.asset( + 'assets/images/lv/lv${item.author!.level}.png', + height: 11, + ), + ], + ), + Row( + children: [ + if (item.pushTimeStr != null) ...[ + Text( + item.pushTimeStr!, + style: TextStyle( + color: theme.colorScheme.outline, + fontSize: 12, + ), + ), + const SizedBox(width: 10), + ], + ...List.generate( + 5, + (index) { + if (index <= item.score - 1) { + return const Icon( + CustomIcon.star_favorite_solid, + size: 13, + color: Color(0xFFFFAD35), + ); + } + return const Icon( + CustomIcon.star_favorite_line, + size: 14, + color: Colors.grey, + ); + }, + ), + ], + ) + ], + ) + ], ), ), - if (isLongReview) - Text( - item.content!, - style: const TextStyle(height: 1.75), - ) - else - SelectableText( - item.content!, - style: const TextStyle(height: 1.75), - ), - Builder( - builder: (context) { - final Color color = theme.colorScheme.outline; - final Color primary = theme.colorScheme.primary; - final ButtonStyle style = TextButton.styleFrom( - padding: EdgeInsets.zero, - tapTargetSize: MaterialTapTargetSize.shrinkWrap, - visualDensity: VisualDensity.compact, - ); - final isLike = item.stat?.liked == 1; - late final isDislike = item.stat?.disliked == 1; - return Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - if (!isLongReview) + const SizedBox(height: 5), + if (item.title != null) + Text( + item.title!, + style: const TextStyle( + height: 1.75, + fontSize: 15, + fontWeight: FontWeight.bold, + ), + ), + if (isLongReview) + Text( + item.content!, + style: const TextStyle(height: 1.75), + ) + else + SelectableText( + item.content!, + style: const TextStyle(height: 1.75), + ), + Builder( + builder: (context) { + final Color color = theme.colorScheme.outline; + final Color primary = theme.colorScheme.primary; + final ButtonStyle style = TextButton.styleFrom( + padding: EdgeInsets.zero, + tapTargetSize: MaterialTapTargetSize.shrinkWrap, + visualDensity: VisualDensity.compact, + ); + final isLike = item.stat?.liked == 1; + late final isDislike = item.stat?.disliked == 1; + return Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + if (!isLongReview) + SizedBox( + height: 32, + child: TextButton( + style: style, + onPressed: () => _controller.onDislike( + index, isDislike, item.reviewId), + child: Icon( + isDislike + ? FontAwesomeIcons.solidThumbsDown + : FontAwesomeIcons.thumbsDown, + size: 16, + color: isDislike ? primary : color, + ), + ), + ), SizedBox( height: 32, child: TextButton( style: style, - onPressed: () => _controller.onDislike( - index, isDislike, item.reviewId), - child: Icon( - isDislike - ? FontAwesomeIcons.solidThumbsDown - : FontAwesomeIcons.thumbsDown, - size: 16, - color: isDislike ? primary : color, + onPressed: isLongReview + ? null + : () => _controller.onLike( + index, isLike, item.reviewId), + child: Row( + spacing: 4, + children: [ + Icon( + isLike + ? FontAwesomeIcons.solidThumbsUp + : FontAwesomeIcons.thumbsUp, + size: 16, + color: isLike ? primary : color, + ), + Text( + Utils.numFormat(item.stat?.likes ?? 0), + style: TextStyle( + color: isLike ? primary : color, + fontSize: 12, + ), + ), + ], ), ), ), - SizedBox( - height: 32, - child: TextButton( - style: style, - onPressed: isLongReview - ? null - : () => _controller.onLike( - index, isLike, item.reviewId), - child: Row( - spacing: 4, - children: [ - Icon( - isLike - ? FontAwesomeIcons.solidThumbsUp - : FontAwesomeIcons.thumbsUp, - size: 16, - color: isLike ? primary : color, - ), - Text( - Utils.numFormat(item.stat?.likes ?? 0), - style: TextStyle( - color: isLike ? primary : color, - fontSize: 12, - ), - ), - ], - ), - ), - ), - ], - ); - }, - ), - ], + ], + ); + }, + ), + ], + ), ), ), ); diff --git a/lib/pages/pgc_review/view.dart b/lib/pages/pgc_review/view.dart index c0608e47..3dabeb7c 100644 --- a/lib/pages/pgc_review/view.dart +++ b/lib/pages/pgc_review/view.dart @@ -82,19 +82,16 @@ class _PgcReviewPageState extends State ), ), Expanded( - child: Material( - color: Colors.transparent, - child: TabBarView( - controller: _tabController, - physics: const NeverScrollableScrollPhysics(), - children: PgcReviewType.values - .map((e) => PgcReviewChildPage( - type: e, - name: widget.name, - mediaId: widget.mediaId, - )) - .toList(), - ), + child: TabBarView( + controller: _tabController, + physics: const NeverScrollableScrollPhysics(), + children: PgcReviewType.values + .map((e) => PgcReviewChildPage( + type: e, + name: widget.name, + mediaId: widget.mediaId, + )) + .toList(), ), ), ], diff --git a/lib/pages/rank/view.dart b/lib/pages/rank/view.dart index edeb67f9..ab1957b8 100644 --- a/lib/pages/rank/view.dart +++ b/lib/pages/rank/view.dart @@ -33,21 +33,21 @@ class _RankPageState extends State child: Column( children: List.generate( RankType.values.length, - (index) => Obx( - () => IntrinsicHeight( - child: InkWell( - onTap: () { - if (_rankController.tabIndex.value != index) { - _rankController.tabIndex.value = index; - _rankController.tabController.animateTo(index); - } else { - _rankController.animateToTop(); - } - }, - child: ColoredBox( - color: index == _rankController.tabIndex.value - ? theme.colorScheme.onInverseSurface - : theme.colorScheme.surface, + (index) => IntrinsicHeight( + child: Obx( + () => Ink( + color: index == _rankController.tabIndex.value + ? theme.colorScheme.onInverseSurface + : theme.colorScheme.surface, + child: InkWell( + onTap: () { + if (_rankController.tabIndex.value != index) { + _rankController.tabIndex.value = index; + _rankController.tabController.animateTo(index); + } else { + _rankController.animateToTop(); + } + }, child: Row( mainAxisSize: MainAxisSize.min, children: [ diff --git a/lib/pages/rank/zone/widget/pgc_rank_item.dart b/lib/pages/rank/zone/widget/pgc_rank_item.dart index 103d54b1..d4835855 100644 --- a/lib/pages/rank/zone/widget/pgc_rank_item.dart +++ b/lib/pages/rank/zone/widget/pgc_rank_item.dart @@ -15,7 +15,7 @@ class PgcRankItem extends StatelessWidget { @override Widget build(BuildContext context) { return Material( - color: Colors.transparent, + type: MaterialType.transparency, child: InkWell( onTap: () { if (item.url != null) { diff --git a/lib/pages/rcmd/view.dart b/lib/pages/rcmd/view.dart index 239df63e..2aebc1ed 100644 --- a/lib/pages/rcmd/view.dart +++ b/lib/pages/rcmd/view.dart @@ -75,7 +75,6 @@ class _RcmdPageState extends CommonPageState ..animateToTop() ..onRefresh(), child: Card( - margin: EdgeInsets.zero, child: Container( alignment: Alignment.center, padding: const EdgeInsets.symmetric(horizontal: 10), diff --git a/lib/pages/search/widgets/hot_keyword.dart b/lib/pages/search/widgets/hot_keyword.dart index d0ac776e..b3112e58 100644 --- a/lib/pages/search/widgets/hot_keyword.dart +++ b/lib/pages/search/widgets/hot_keyword.dart @@ -27,10 +27,10 @@ class HotKeyword extends StatelessWidget { SizedBox( width: width, child: Material( - color: Colors.transparent, + type: MaterialType.transparency, borderRadius: const BorderRadius.all(Radius.circular(3)), - clipBehavior: Clip.hardEdge, child: InkWell( + borderRadius: const BorderRadius.all(Radius.circular(3)), onTap: () => onClick?.call(i.keyword), child: Padding( padding: const EdgeInsets.only(left: 2, right: 10), diff --git a/lib/pages/search_panel/all/widgets/pgc_card_v_search.dart b/lib/pages/search_panel/all/widgets/pgc_card_v_search.dart index 83e773b4..341736ca 100644 --- a/lib/pages/search_panel/all/widgets/pgc_card_v_search.dart +++ b/lib/pages/search_panel/all/widgets/pgc_card_v_search.dart @@ -1,3 +1,4 @@ +import 'package:PiliPlus/common/constants.dart'; import 'package:PiliPlus/common/widgets/badge.dart'; import 'package:PiliPlus/common/widgets/image/image_save.dart'; import 'package:PiliPlus/common/widgets/image/network_img_layer.dart'; @@ -17,9 +18,9 @@ class PgcCardVSearch extends StatelessWidget { @override Widget build(BuildContext context) { return Card( - clipBehavior: Clip.hardEdge, - margin: EdgeInsets.zero, + shape: const RoundedRectangleBorder(borderRadius: StyleString.mdRadius), child: InkWell( + borderRadius: StyleString.mdRadius, onLongPress: () => imageSaveDialog( title: item.title.map((e) => e.text).join(), cover: item.cover, diff --git a/lib/pages/search_panel/article/controller.dart b/lib/pages/search_panel/article/controller.dart index cb9d8b55..9bfeee4d 100644 --- a/lib/pages/search_panel/article/controller.dart +++ b/lib/pages/search_panel/article/controller.dart @@ -65,7 +65,6 @@ class SearchArticleController context: context, useSafeArea: true, isScrollControlled: true, - clipBehavior: Clip.hardEdge, constraints: BoxConstraints( maxWidth: min(640, context.mediaQueryShortestSide), ), diff --git a/lib/pages/search_panel/article/widgets/item.dart b/lib/pages/search_panel/article/widgets/item.dart index 1f2df702..4c4ddfe4 100644 --- a/lib/pages/search_panel/article/widgets/item.dart +++ b/lib/pages/search_panel/article/widgets/item.dart @@ -18,75 +18,78 @@ class SearchArticleItem extends StatelessWidget { fontSize: theme.textTheme.labelSmall!.fontSize, color: theme.colorScheme.outline, ); - return InkWell( - onTap: () => Get.toNamed( - '/articlePage', - parameters: { - 'id': '${item.id}', - 'type': 'read', - }, - ), - onLongPress: () => imageSaveDialog( - title: item.title.map((item) => item.text).join(), - cover: item.imageUrls?.firstOrNull, - ), - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: StyleString.safeSpace, - vertical: 5, + return Material( + type: MaterialType.transparency, + child: InkWell( + onTap: () => Get.toNamed( + '/articlePage', + parameters: { + 'id': '${item.id}', + 'type': 'read', + }, ), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (item.imageUrls?.isNotEmpty == true) - AspectRatio( - aspectRatio: StyleString.aspectRatio, - child: LayoutBuilder(builder: (context, boxConstraints) { - double maxWidth = boxConstraints.maxWidth; - double maxHeight = boxConstraints.maxHeight; - return NetworkImgLayer( - width: maxWidth, - height: maxHeight, - src: item.imageUrls?.firstOrNull, - ); - }), + onLongPress: () => imageSaveDialog( + title: item.title.map((item) => item.text).join(), + cover: item.imageUrls?.firstOrNull, + ), + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: StyleString.safeSpace, + vertical: 5, + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (item.imageUrls?.isNotEmpty == true) + AspectRatio( + aspectRatio: StyleString.aspectRatio, + child: LayoutBuilder(builder: (context, boxConstraints) { + double maxWidth = boxConstraints.maxWidth; + double maxHeight = boxConstraints.maxHeight; + return NetworkImgLayer( + width: maxWidth, + height: maxHeight, + src: item.imageUrls?.firstOrNull, + ); + }), + ), + const SizedBox(width: 10), + Expanded( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text.rich( + maxLines: 2, + TextSpan( + children: item.title + .map((e) => TextSpan( + text: e.text, + style: TextStyle( + color: e.isEm + ? theme.colorScheme.primary + : theme.colorScheme.onSurface, + ), + )) + .toList()), + ), + const Spacer(), + Text( + Utils.dateFormat(item.pubTime, formatType: 'detail'), + style: textStyle, + ), + Row( + children: [ + Text('${item.view}浏览', style: textStyle), + Text(' • ', style: textStyle), + Text('${item.reply}评论', style: textStyle), + ], + ), + ], + ), ), - const SizedBox(width: 10), - Expanded( - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text.rich( - maxLines: 2, - TextSpan( - children: item.title - .map((e) => TextSpan( - text: e.text, - style: TextStyle( - color: e.isEm - ? theme.colorScheme.primary - : theme.colorScheme.onSurface, - ), - )) - .toList()), - ), - const Spacer(), - Text( - Utils.dateFormat(item.pubTime, formatType: 'detail'), - style: textStyle, - ), - Row( - children: [ - Text('${item.view}浏览', style: textStyle), - Text(' • ', style: textStyle), - Text('${item.reply}评论', style: textStyle), - ], - ), - ], - ), - ), - ], + ], + ), ), ), ); diff --git a/lib/pages/search_panel/live/widgets/item.dart b/lib/pages/search_panel/live/widgets/item.dart index 29032569..7ef26007 100644 --- a/lib/pages/search_panel/live/widgets/item.dart +++ b/lib/pages/search_panel/live/widgets/item.dart @@ -1,7 +1,6 @@ import 'package:PiliPlus/common/constants.dart'; import 'package:PiliPlus/common/widgets/image/image_save.dart'; import 'package:PiliPlus/common/widgets/image/network_img_layer.dart'; -import 'package:PiliPlus/models/common/image_type.dart'; import 'package:PiliPlus/models/search/result.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; @@ -15,9 +14,7 @@ class LiveItem extends StatelessWidget { Widget build(BuildContext context) { final theme = Theme.of(context); return Card( - elevation: 1, clipBehavior: Clip.hardEdge, - margin: EdgeInsets.zero, child: InkWell( onTap: () => Get.toNamed('/liveRoom?roomid=${liveItem.roomid}'), onLongPress: () => imageSaveDialog( @@ -36,9 +33,9 @@ class LiveItem extends StatelessWidget { children: [ NetworkImgLayer( src: liveItem.cover, - type: ImageType.emote, width: maxWidth, height: maxHeight, + radius: 0, ), Positioned( left: 0, diff --git a/lib/pages/search_panel/pgc/widgets/item.dart b/lib/pages/search_panel/pgc/widgets/item.dart index 44e3b637..142dfee7 100644 --- a/lib/pages/search_panel/pgc/widgets/item.dart +++ b/lib/pages/search_panel/pgc/widgets/item.dart @@ -19,86 +19,89 @@ class SearchPgcItem extends StatelessWidget { Widget build(BuildContext context) { final ThemeData theme = Theme.of(context); const TextStyle style = TextStyle(fontSize: 13); - return InkWell( - onTap: () => PageUtils.viewPgc(seasonId: item.seasonId), - onLongPress: () => imageSaveDialog( - title: item.title.map((item) => item.text).join(), - cover: item.cover, - ), - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: StyleString.safeSpace, - vertical: StyleString.cardSpace, + return Material( + type: MaterialType.transparency, + child: InkWell( + onTap: () => PageUtils.viewPgc(seasonId: item.seasonId), + onLongPress: () => imageSaveDialog( + title: item.title.map((item) => item.text).join(), + cover: item.cover, ), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Stack( - clipBehavior: Clip.none, - children: [ - NetworkImgLayer( - width: 111, - height: 148, - src: item.cover, - ), - PBadge( - text: item.seasonTypeName, - top: 6.0, - right: 4.0, - bottom: null, - left: null, - ) - ], - ), - const SizedBox(width: 10), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: StyleString.safeSpace, + vertical: StyleString.cardSpace, + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Stack( + clipBehavior: Clip.none, children: [ - const SizedBox(height: 4), - Text.rich( - TextSpan( - children: item.title - .map((e) => TextSpan( - text: e.text, - style: TextStyle( - color: e.isEm - ? theme.colorScheme.primary - : theme.colorScheme.onSurface, - ), - )) - .toList()), - ), - const SizedBox(height: 12), - Text('评分:${item.mediaScore?['score']}', style: style), - Row( - children: [ - if (item.areas?.isNotEmpty == true) - Text(item.areas!, style: style), - const SizedBox(width: 3), - const Text('·'), - const SizedBox(width: 3), - Text( - Utils.dateFormat(item.pubtime).toString(), - style: style, - ), - ], - ), - Row( - children: [ - if (item.styles?.isNotEmpty == true) - Text(item.styles!, style: style), - const SizedBox(width: 3), - const Text('·'), - const SizedBox(width: 3), - if (item.indexShow?.isNotEmpty == true) - Text(item.indexShow!, style: style), - ], + NetworkImgLayer( + width: 111, + height: 148, + src: item.cover, ), + PBadge( + text: item.seasonTypeName, + top: 6.0, + right: 4.0, + bottom: null, + left: null, + ) ], ), - ), - ], + const SizedBox(width: 10), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const SizedBox(height: 4), + Text.rich( + TextSpan( + children: item.title + .map((e) => TextSpan( + text: e.text, + style: TextStyle( + color: e.isEm + ? theme.colorScheme.primary + : theme.colorScheme.onSurface, + ), + )) + .toList()), + ), + const SizedBox(height: 12), + Text('评分:${item.mediaScore?['score']}', style: style), + Row( + children: [ + if (item.areas?.isNotEmpty == true) + Text(item.areas!, style: style), + const SizedBox(width: 3), + const Text('·'), + const SizedBox(width: 3), + Text( + Utils.dateFormat(item.pubtime).toString(), + style: style, + ), + ], + ), + Row( + children: [ + if (item.styles?.isNotEmpty == true) + Text(item.styles!, style: style), + const SizedBox(width: 3), + const Text('·'), + const SizedBox(width: 3), + if (item.indexShow?.isNotEmpty == true) + Text(item.indexShow!, style: style), + ], + ), + ], + ), + ), + ], + ), ), ), ); diff --git a/lib/pages/search_panel/user/controller.dart b/lib/pages/search_panel/user/controller.dart index 6c549827..d83e894f 100644 --- a/lib/pages/search_panel/user/controller.dart +++ b/lib/pages/search_panel/user/controller.dart @@ -37,7 +37,6 @@ class SearchUserController context: context, useSafeArea: true, isScrollControlled: true, - clipBehavior: Clip.hardEdge, constraints: BoxConstraints( maxWidth: min(640, context.mediaQueryShortestSide), ), diff --git a/lib/pages/search_panel/user/widgets/item.dart b/lib/pages/search_panel/user/widgets/item.dart index af2baca5..bd1d6eb4 100644 --- a/lib/pages/search_panel/user/widgets/item.dart +++ b/lib/pages/search_panel/user/widgets/item.dart @@ -14,62 +14,61 @@ class SearchUserItem extends StatelessWidget { @override Widget build(BuildContext context) { - String heroTag = Utils.makeHeroTag(item.mid); final theme = Theme.of(context); final style = TextStyle( fontSize: theme.textTheme.labelSmall!.fontSize, color: theme.colorScheme.outline, ); - return InkWell( - onTap: () => Get.toNamed( - '/member?mid=${item.mid}', - arguments: {'heroTag': heroTag, 'face': item.upic}, - ), - child: Row( - children: [ - const SizedBox(width: 15), - PendantAvatar( - avatar: item.upic, - size: 42, - isVip: false, - officialType: item.officialVerify?['type'], - roomId: item.isLive == 1 ? item.roomId : null, - ), - const SizedBox(width: 10), - Column( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Row( - children: [ - Text( - item.uname!, - style: const TextStyle( - fontSize: 14, + return Material( + type: MaterialType.transparency, + child: InkWell( + onTap: () => Get.toNamed('/member?mid=${item.mid}'), + child: Row( + children: [ + const SizedBox(width: 15), + PendantAvatar( + avatar: item.upic, + size: 42, + isVip: false, + officialType: item.officialVerify?['type'], + roomId: item.isLive == 1 ? item.roomId : null, + ), + const SizedBox(width: 10), + Column( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + children: [ + Text( + item.uname!, + style: const TextStyle( + fontSize: 14, + ), ), - ), - const SizedBox(width: 6), - Image.asset( - 'assets/images/lv/lv${item.isSeniorMember == 1 ? '6_s' : item.level}.png', - height: 11, - semanticLabel: '等级${item.level}', - ), - ], - ), - Text( - '粉丝:${Utils.numFormat(item.fans)} 视频:${Utils.numFormat(item.videos)}', - style: style, - ), - if (item.officialVerify?['desc'] != null && - item.officialVerify?['desc'] != '') + const SizedBox(width: 6), + Image.asset( + 'assets/images/lv/lv${item.isSeniorMember == 1 ? '6_s' : item.level}.png', + height: 11, + semanticLabel: '等级${item.level}', + ), + ], + ), Text( - item.officialVerify?['desc'], + '粉丝:${Utils.numFormat(item.fans)} 视频:${Utils.numFormat(item.videos)}', style: style, ), - ], - ) - ], + if (item.officialVerify?['desc'] != null && + item.officialVerify?['desc'] != '') + Text( + item.officialVerify?['desc'], + style: style, + ), + ], + ) + ], + ), ), ); } diff --git a/lib/pages/search_panel/video/controller.dart b/lib/pages/search_panel/video/controller.dart index 403e826a..5077ef2d 100644 --- a/lib/pages/search_panel/video/controller.dart +++ b/lib/pages/search_panel/video/controller.dart @@ -144,7 +144,6 @@ class SearchVideoController context: context, useSafeArea: true, isScrollControlled: true, - clipBehavior: Clip.hardEdge, constraints: BoxConstraints( maxWidth: min(640, context.mediaQueryShortestSide), ), diff --git a/lib/pages/search_result/view.dart b/lib/pages/search_result/view.dart index b1403cfc..99847cfb 100644 --- a/lib/pages/search_result/view.dart +++ b/lib/pages/search_result/view.dart @@ -147,49 +147,46 @@ class _SearchResultPageState extends State ), ), Expanded( - child: Material( - color: Colors.transparent, - child: tabBarView( - controller: _tabController, - children: SearchType.values - .map( - (item) => switch (item) { - // SearchType.all => SearchAllPanel( - // tag: _tag, - // searchType: item, - // keyword: _searchResultController.keyword, - // ), - SearchType.video => SearchVideoPanel( - tag: _tag, - searchType: item, - keyword: _searchResultController.keyword, - ), - SearchType.media_bangumi || - SearchType.media_ft => - SearchPgcPanel( - tag: _tag, - searchType: item, - keyword: _searchResultController.keyword, - ), - SearchType.live_room => SearchLivePanel( - tag: _tag, - searchType: item, - keyword: _searchResultController.keyword, - ), - SearchType.bili_user => SearchUserPanel( - tag: _tag, - searchType: item, - keyword: _searchResultController.keyword, - ), - SearchType.article => SearchArticlePanel( - tag: _tag, - searchType: item, - keyword: _searchResultController.keyword, - ), - }, - ) - .toList(), - ), + child: tabBarView( + controller: _tabController, + children: SearchType.values + .map( + (item) => switch (item) { + // SearchType.all => SearchAllPanel( + // tag: _tag, + // searchType: item, + // keyword: _searchResultController.keyword, + // ), + SearchType.video => SearchVideoPanel( + tag: _tag, + searchType: item, + keyword: _searchResultController.keyword, + ), + SearchType.media_bangumi || + SearchType.media_ft => + SearchPgcPanel( + tag: _tag, + searchType: item, + keyword: _searchResultController.keyword, + ), + SearchType.live_room => SearchLivePanel( + tag: _tag, + searchType: item, + keyword: _searchResultController.keyword, + ), + SearchType.bili_user => SearchUserPanel( + tag: _tag, + searchType: item, + keyword: _searchResultController.keyword, + ), + SearchType.article => SearchArticlePanel( + tag: _tag, + searchType: item, + keyword: _searchResultController.keyword, + ), + }, + ) + .toList(), ), ), ], diff --git a/lib/pages/setting/pages/logs.dart b/lib/pages/setting/pages/logs.dart index 60f1bf5a..84d67da8 100644 --- a/lib/pages/setting/pages/logs.dart +++ b/lib/pages/setting/pages/logs.dart @@ -213,8 +213,6 @@ class _LogsPageState extends State { ], ), Card( - elevation: 1, - margin: EdgeInsets.zero, child: Container( width: double.infinity, padding: const EdgeInsets.all(12.0), diff --git a/lib/pages/setting/view.dart b/lib/pages/setting/view.dart index bc9c1073..ee32209a 100644 --- a/lib/pages/setting/view.dart +++ b/lib/pages/setting/view.dart @@ -287,25 +287,28 @@ class _SettingPageState extends State { right: 16, bottom: 8, ), - child: InkWell( - onTap: () => Get.toNamed('/settingsSearch'), - borderRadius: const BorderRadius.all(Radius.circular(50)), - child: Ink( - padding: const EdgeInsets.symmetric(vertical: 6), - decoration: BoxDecoration( - borderRadius: const BorderRadius.all(Radius.circular(50)), - color: theme.colorScheme.onInverseSurface, - ), - child: Center( - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - Icon( - size: MediaQuery.textScalerOf(context).scale(18), - Icons.search, - ), - const Text(' 搜索'), - ], + child: Material( + type: MaterialType.transparency, + child: InkWell( + onTap: () => Get.toNamed('/settingsSearch'), + borderRadius: const BorderRadius.all(Radius.circular(50)), + child: Ink( + padding: const EdgeInsets.symmetric(vertical: 6), + decoration: BoxDecoration( + borderRadius: const BorderRadius.all(Radius.circular(50)), + color: theme.colorScheme.onInverseSurface, + ), + child: Center( + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Icon( + size: MediaQuery.textScalerOf(context).scale(18), + Icons.search, + ), + const Text(' 搜索'), + ], + ), ), ), ), diff --git a/lib/pages/subscription/widgets/item.dart b/lib/pages/subscription/widgets/item.dart index 5f13987b..d04bb1b1 100644 --- a/lib/pages/subscription/widgets/item.dart +++ b/lib/pages/subscription/widgets/item.dart @@ -25,71 +25,74 @@ class SubItem extends StatelessWidget { 21 => '合集', _ => '其它(${item.type})', }; - return InkWell( - onTap: () { - if (item.state == 1) { - SmartDialog.showToast('该$type已失效'); - return; - } - if (item.type == 11) { - Get.toNamed( - '/favDetail', - parameters: { - 'mediaId': item.id!.toString(), - 'heroTag': heroTag, - }, - ); - } else { - Get.toNamed( - '/subDetail', - arguments: item, - parameters: { - 'heroTag': heroTag, - 'id': item.id.toString(), - }, - ); - } - }, - onLongPress: () => imageSaveDialog( - title: item.title, - cover: item.cover, - ), - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 5), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AspectRatio( - aspectRatio: StyleString.aspectRatio, - child: LayoutBuilder( - builder: (context, boxConstraints) { - double maxWidth = boxConstraints.maxWidth; - double maxHeight = boxConstraints.maxHeight; - return Stack( - clipBehavior: Clip.none, - children: [ - Hero( - tag: heroTag, - child: NetworkImgLayer( - src: item.cover, - width: maxWidth, - height: maxHeight, + return Material( + type: MaterialType.transparency, + child: InkWell( + onTap: () { + if (item.state == 1) { + SmartDialog.showToast('该$type已失效'); + return; + } + if (item.type == 11) { + Get.toNamed( + '/favDetail', + parameters: { + 'mediaId': item.id!.toString(), + 'heroTag': heroTag, + }, + ); + } else { + Get.toNamed( + '/subDetail', + arguments: item, + parameters: { + 'heroTag': heroTag, + 'id': item.id.toString(), + }, + ); + } + }, + onLongPress: () => imageSaveDialog( + title: item.title, + cover: item.cover, + ), + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 5), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AspectRatio( + aspectRatio: StyleString.aspectRatio, + child: LayoutBuilder( + builder: (context, boxConstraints) { + double maxWidth = boxConstraints.maxWidth; + double maxHeight = boxConstraints.maxHeight; + return Stack( + clipBehavior: Clip.none, + children: [ + Hero( + tag: heroTag, + child: NetworkImgLayer( + src: item.cover, + width: maxWidth, + height: maxHeight, + ), ), - ), - PBadge( - right: 6, - top: 6, - text: type, - ) - ], - ); - }, + PBadge( + right: 6, + top: 6, + text: type, + ) + ], + ); + }, + ), ), - ), - const SizedBox(width: 10), - content(context), - ], + const SizedBox(width: 10), + content(context), + ], + ), ), ), ); diff --git a/lib/pages/subscription_detail/view.dart b/lib/pages/subscription_detail/view.dart index 025d8180..52554b5e 100644 --- a/lib/pages/subscription_detail/view.dart +++ b/lib/pages/subscription_detail/view.dart @@ -154,11 +154,7 @@ class _SubDetailPageState extends State { GestureDetector( onTap: () { Get.toNamed( - '/member?mid=${_subDetailController.subInfo.upper!.mid}', - arguments: { - 'face': _subDetailController.subInfo.upper!.face, - }, - ); + '/member?mid=${_subDetailController.subInfo.upper!.mid}'); }, child: Text( _subDetailController.subInfo.upper!.name!, diff --git a/lib/pages/subscription_detail/widget/sub_video_card.dart b/lib/pages/subscription_detail/widget/sub_video_card.dart index af2dafb7..6048c015 100644 --- a/lib/pages/subscription_detail/widget/sub_video_card.dart +++ b/lib/pages/subscription_detail/widget/sub_video_card.dart @@ -25,62 +25,65 @@ class SubVideoCardH extends StatelessWidget { @override Widget build(BuildContext context) { - return InkWell( - onTap: () async { - int? cid = await SearchHttp.ab2c(bvid: videoItem.bvid); - if (cid != null) { - PageUtils.toVideoPage( - 'bvid=${videoItem.bvid}&cid=$cid', - arguments: { - 'videoItem': videoItem, - 'heroTag': Utils.makeHeroTag(videoItem.id), - 'videoType': SearchType.video, - }, - ); - } - }, - onLongPress: () => imageSaveDialog( - title: videoItem.title, - cover: videoItem.cover, - bvid: videoItem.bvid, - ), - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: StyleString.safeSpace, - vertical: 5, + return Material( + type: MaterialType.transparency, + child: InkWell( + onTap: () async { + int? cid = await SearchHttp.ab2c(bvid: videoItem.bvid); + if (cid != null) { + PageUtils.toVideoPage( + 'bvid=${videoItem.bvid}&cid=$cid', + arguments: { + 'videoItem': videoItem, + 'heroTag': Utils.makeHeroTag(videoItem.id), + 'videoType': SearchType.video, + }, + ); + } + }, + onLongPress: () => imageSaveDialog( + title: videoItem.title, + cover: videoItem.cover, + bvid: videoItem.bvid, ), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AspectRatio( - aspectRatio: StyleString.aspectRatio, - child: LayoutBuilder( - builder: (context, boxConstraints) { - double maxWidth = boxConstraints.maxWidth; - double maxHeight = boxConstraints.maxHeight; - return Stack( - clipBehavior: Clip.none, - children: [ - NetworkImgLayer( - src: videoItem.cover, - width: maxWidth, - height: maxHeight, - ), - PBadge( - text: Utils.timeFormat(videoItem.duration!), - right: 6.0, - bottom: 6.0, - type: PBadgeType.gray, - ), - ], - ); - }, + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: StyleString.safeSpace, + vertical: 5, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AspectRatio( + aspectRatio: StyleString.aspectRatio, + child: LayoutBuilder( + builder: (context, boxConstraints) { + double maxWidth = boxConstraints.maxWidth; + double maxHeight = boxConstraints.maxHeight; + return Stack( + clipBehavior: Clip.none, + children: [ + NetworkImgLayer( + src: videoItem.cover, + width: maxWidth, + height: maxHeight, + ), + PBadge( + text: Utils.timeFormat(videoItem.duration!), + right: 6.0, + bottom: 6.0, + type: PBadgeType.gray, + ), + ], + ); + }, + ), ), - ), - const SizedBox(width: 10), - content(context), - ], + const SizedBox(width: 10), + content(context), + ], + ), ), ), ); diff --git a/lib/pages/video/introduction/pgc/view.dart b/lib/pages/video/introduction/pgc/view.dart index 4655e01d..8a61f05c 100644 --- a/lib/pages/video/introduction/pgc/view.dart +++ b/lib/pages/video/introduction/pgc/view.dart @@ -12,7 +12,6 @@ import 'package:PiliPlus/pages/video/controller.dart'; import 'package:PiliPlus/pages/video/introduction/pgc/controller.dart'; import 'package:PiliPlus/pages/video/introduction/pgc/widgets/pgc_panel.dart'; import 'package:PiliPlus/pages/video/introduction/ugc/widgets/action_item.dart'; -import 'package:PiliPlus/pages/video/introduction/ugc/widgets/action_row_item.dart'; import 'package:PiliPlus/utils/extension.dart'; import 'package:PiliPlus/utils/utils.dart'; import 'package:flutter/material.dart'; @@ -261,148 +260,86 @@ class _PgcIntroPageState extends State Widget actionGrid(ThemeData theme, PgcInfoModel item, PgcIntroController pgcIntroController) { - return Material( - color: theme.colorScheme.surface, - child: Padding( - padding: const EdgeInsets.only(top: 1), - child: SizedBox( - height: 48, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Obx( - () => ActionItem( - icon: const Icon(FontAwesomeIcons.thumbsUp), - selectIcon: const Icon(FontAwesomeIcons.solidThumbsUp), - onTap: () => handleState(pgcIntroController.actionLikeVideo), - onLongPress: pgcIntroController.actionOneThree, - selectStatus: pgcIntroController.hasLike.value, - isLoading: false, - semanticsLabel: '点赞', - text: Utils.numFormat(item.stat!.likes), - needAnim: true, - hasTriple: pgcIntroController.hasLike.value && - pgcIntroController.hasCoin && - pgcIntroController.hasFav.value, - callBack: (start) { - if (start) { - HapticFeedback.lightImpact(); - _coinKey.currentState?.controller?.forward(); - _favKey.currentState?.controller?.forward(); - } else { - _coinKey.currentState?.controller?.reverse(); - _favKey.currentState?.controller?.reverse(); - } - }, - ), - ), - Obx( - () => ActionItem( - key: _coinKey, - icon: const Icon(FontAwesomeIcons.b), - selectIcon: const Icon(FontAwesomeIcons.b), - onTap: () => handleState(pgcIntroController.actionCoinVideo), - selectStatus: pgcIntroController.hasCoin, - isLoading: false, - semanticsLabel: '投币', - text: Utils.numFormat(item.stat!.coins), - needAnim: true, - ), - ), - Obx( - () => ActionItem( - key: _favKey, - icon: const Icon(FontAwesomeIcons.star), - selectIcon: const Icon(FontAwesomeIcons.solidStar), - onTap: () => pgcIntroController.showFavBottomSheet(context), - onLongPress: () => pgcIntroController - .showFavBottomSheet(context, type: 'longPress'), - selectStatus: pgcIntroController.hasFav.value, - isLoading: false, - semanticsLabel: '收藏', - text: Utils.numFormat(item.stat!.favorite), - needAnim: true, - ), - ), - ActionItem( - icon: const Icon(FontAwesomeIcons.comment), - selectIcon: const Icon(FontAwesomeIcons.reply), - onTap: () => videoDetailCtr.tabCtr.animateTo(1), - selectStatus: false, - isLoading: false, - semanticsLabel: '评论', - text: Utils.numFormat(item.stat!.reply), - ), - ActionItem( - icon: const Icon(FontAwesomeIcons.shareFromSquare), - onTap: () => pgcIntroController.actionShareVideo(context), - selectStatus: false, - isLoading: false, - semanticsLabel: '转发', - text: Utils.numFormat(item.stat!.share), - ), - ], + return SizedBox( + height: 48, + child: Row( + children: [ + Obx( + () => ActionItem( + icon: const Icon(FontAwesomeIcons.thumbsUp), + selectIcon: const Icon(FontAwesomeIcons.solidThumbsUp), + onTap: () => handleState(pgcIntroController.actionLikeVideo), + onLongPress: pgcIntroController.actionOneThree, + selectStatus: pgcIntroController.hasLike.value, + isLoading: false, + semanticsLabel: '点赞', + text: Utils.numFormat(item.stat!.likes), + needAnim: true, + hasTriple: pgcIntroController.hasLike.value && + pgcIntroController.hasCoin && + pgcIntroController.hasFav.value, + callBack: (start) { + if (start) { + HapticFeedback.lightImpact(); + _coinKey.currentState?.controller?.forward(); + _favKey.currentState?.controller?.forward(); + } else { + _coinKey.currentState?.controller?.reverse(); + _favKey.currentState?.controller?.reverse(); + } + }, + ), ), - ), + Obx( + () => ActionItem( + key: _coinKey, + icon: const Icon(FontAwesomeIcons.b), + selectIcon: const Icon(FontAwesomeIcons.b), + onTap: () => handleState(pgcIntroController.actionCoinVideo), + selectStatus: pgcIntroController.hasCoin, + isLoading: false, + semanticsLabel: '投币', + text: Utils.numFormat(item.stat!.coins), + needAnim: true, + ), + ), + Obx( + () => ActionItem( + key: _favKey, + icon: const Icon(FontAwesomeIcons.star), + selectIcon: const Icon(FontAwesomeIcons.solidStar), + onTap: () => pgcIntroController.showFavBottomSheet(context), + onLongPress: () => pgcIntroController.showFavBottomSheet(context, + type: 'longPress'), + selectStatus: pgcIntroController.hasFav.value, + isLoading: false, + semanticsLabel: '收藏', + text: Utils.numFormat(item.stat!.favorite), + needAnim: true, + ), + ), + ActionItem( + icon: const Icon(FontAwesomeIcons.comment), + selectIcon: const Icon(FontAwesomeIcons.reply), + onTap: () => videoDetailCtr.tabCtr.animateTo(1), + selectStatus: false, + isLoading: false, + semanticsLabel: '评论', + text: Utils.numFormat(item.stat!.reply), + ), + ActionItem( + icon: const Icon(FontAwesomeIcons.shareFromSquare), + onTap: () => pgcIntroController.actionShareVideo(context), + selectStatus: false, + isLoading: false, + semanticsLabel: '转发', + text: Utils.numFormat(item.stat!.share), + ), + ], ), ); } - Widget actionRow( - PgcInfoModel item, - PgcIntroController pgcIntroController, - VideoDetailController videoDetailCtr, - ) { - return Row( - spacing: 8, - children: [ - Obx( - () => ActionRowItem( - icon: const Icon(FontAwesomeIcons.thumbsUp), - onTap: () => handleState(pgcIntroController.actionLikeVideo), - selectStatus: pgcIntroController.hasLike.value, - isLoading: false, - text: item.stat!.likes!.toString(), - ), - ), - Obx( - () => ActionRowItem( - icon: const Icon(FontAwesomeIcons.b), - onTap: () => handleState(pgcIntroController.actionCoinVideo), - selectStatus: pgcIntroController.hasCoin, - isLoading: false, - text: item.stat!.coins!.toString(), - ), - ), - Obx( - () => ActionRowItem( - icon: const Icon(FontAwesomeIcons.heart), - onTap: () => pgcIntroController.showFavBottomSheet(context), - onLongPress: () => pgcIntroController.showFavBottomSheet(context, - type: 'longPress'), - selectStatus: pgcIntroController.hasFav.value, - isLoading: false, - text: item.stat!.favorite!.toString(), - ), - ), - ActionRowItem( - icon: const Icon(FontAwesomeIcons.comment), - onTap: () => videoDetailCtr.tabCtr.animateTo(1), - selectStatus: false, - isLoading: false, - text: item.stat!.reply!.toString(), - ), - ActionRowItem( - icon: const Icon(FontAwesomeIcons.share), - onTap: () => pgcIntroController.actionShareVideo(context), - selectStatus: false, - isLoading: false, - text: '转发', - ), - ], - ); - } - Widget areasAndPubTime(ThemeData theme, PgcInfoModel item) { return Row( spacing: 6, diff --git a/lib/pages/video/introduction/pgc/widgets/pgc_panel.dart b/lib/pages/video/introduction/pgc/widgets/pgc_panel.dart index 32d3a7b8..fbdc33c6 100644 --- a/lib/pages/video/introduction/pgc/widgets/pgc_panel.dart +++ b/lib/pages/video/introduction/pgc/widgets/pgc_panel.dart @@ -144,8 +144,8 @@ class _PgcPanelState extends State { child: Material( color: theme.colorScheme.onInverseSurface, borderRadius: const BorderRadius.all(Radius.circular(6)), - clipBehavior: Clip.hardEdge, child: InkWell( + borderRadius: const BorderRadius.all(Radius.circular(6)), onTap: () { if (item.badge != null && item.badge == '会员' && diff --git a/lib/pages/video/introduction/ugc/view.dart b/lib/pages/video/introduction/ugc/view.dart index 34ffd073..de785127 100644 --- a/lib/pages/video/introduction/ugc/view.dart +++ b/lib/pages/video/introduction/ugc/view.dart @@ -13,7 +13,6 @@ import 'package:PiliPlus/pages/search/widgets/search_text.dart'; import 'package:PiliPlus/pages/video/controller.dart'; import 'package:PiliPlus/pages/video/introduction/ugc/controller.dart'; import 'package:PiliPlus/pages/video/introduction/ugc/widgets/action_item.dart'; -import 'package:PiliPlus/pages/video/introduction/ugc/widgets/action_row_item.dart'; import 'package:PiliPlus/pages/video/introduction/ugc/widgets/page.dart'; import 'package:PiliPlus/pages/video/introduction/ugc/widgets/season.dart'; import 'package:PiliPlus/utils/app_scheme.dart'; @@ -435,7 +434,9 @@ class _VideoInfoState extends State { '${videoItem['staff'][index].mid}'] == null ? Material( - color: Colors.transparent, + type: + MaterialType.transparency, + shape: const CircleBorder(), child: InkWell( customBorder: const CircleBorder(), @@ -837,11 +838,9 @@ class _VideoInfoState extends State { Widget actionGrid( BuildContext context, VideoIntroController videoIntroController) { - return Container( - margin: const EdgeInsets.only(top: 1), + return SizedBox( height: 48, child: Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ Obx( () => ActionItem( @@ -941,63 +940,6 @@ class _VideoInfoState extends State { ); } - Widget actionRow( - BuildContext context, - VideoIntroController videoIntroController, - VideoDetailController videoDetailCtr, - ) { - return Row(children: [ - Obx( - () => ActionRowItem( - icon: const Icon(FontAwesomeIcons.thumbsUp), - onTap: () => handleState(videoIntroController.actionLikeVideo), - selectStatus: videoIntroController.hasLike.value, - isLoading: widget.isLoading, - text: !widget.isLoading ? videoDetail.stat!.like!.toString() : '-', - ), - ), - const SizedBox(width: 8), - Obx( - () => ActionRowItem( - icon: const Icon(FontAwesomeIcons.b), - onTap: () => handleState(videoIntroController.actionCoinVideo), - selectStatus: videoIntroController.hasCoin, - isLoading: widget.isLoading, - text: !widget.isLoading ? videoDetail.stat!.coin!.toString() : '-', - ), - ), - const SizedBox(width: 8), - Obx( - () => ActionRowItem( - icon: const Icon(FontAwesomeIcons.heart), - onTap: () => videoIntroController.showFavBottomSheet(context), - onLongPress: () => videoIntroController.showFavBottomSheet(context, - type: 'longPress'), - selectStatus: videoIntroController.hasFav.value, - isLoading: widget.isLoading, - text: - !widget.isLoading ? videoDetail.stat!.favorite!.toString() : '-', - ), - ), - const SizedBox(width: 8), - ActionRowItem( - icon: const Icon(FontAwesomeIcons.comment), - onTap: () => videoDetailCtr.tabCtr.animateTo(1), - selectStatus: false, - isLoading: widget.isLoading, - text: !widget.isLoading ? videoDetail.stat!.reply!.toString() : '-', - ), - const SizedBox(width: 8), - ActionRowItem( - icon: const Icon(FontAwesomeIcons.share), - onTap: () => videoIntroController.actionShareVideo(context), - selectStatus: false, - isLoading: widget.isLoading, - text: '转发', - ), - ]); - } - InlineSpan buildContent(ThemeData theme, VideoDetailData content) { final List descV2 = content.descV2!; // type @@ -1073,15 +1015,11 @@ class _VideoInfoState extends State { return TextSpan(children: spanChildren); case 2: final Color colorSchemePrimary = theme.colorScheme.primary; - final String heroTag = Utils.makeHeroTag(currentDesc.bizId); return TextSpan( text: '@${currentDesc.rawText}', style: TextStyle(color: colorSchemePrimary), recognizer: TapGestureRecognizer() - ..onTap = () => Get.toNamed( - '/member?mid=${currentDesc.bizId}', - arguments: {'face': '', 'heroTag': heroTag}, - ), + ..onTap = () => Get.toNamed('/member?mid=${currentDesc.bizId}'), ); default: return const TextSpan(); diff --git a/lib/pages/video/introduction/ugc/widgets/action_item.dart b/lib/pages/video/introduction/ugc/widgets/action_item.dart index f692805a..2fa09cdb 100644 --- a/lib/pages/video/introduction/ugc/widgets/action_item.dart +++ b/lib/pages/video/introduction/ugc/widgets/action_item.dart @@ -136,70 +136,73 @@ class ActionItemState extends State label: (widget.text ?? "") + (widget.selectStatus ? "已" : "") + widget.semanticsLabel, - child: InkWell( - borderRadius: const BorderRadius.all(Radius.circular(6)), - onTap: _isThumbsUp - ? null - : () { - feedBack(); - widget.onTap?.call(); - }, - onLongPress: _isThumbsUp ? null : widget.onLongPress, - onTapDown: _isThumbsUp ? (details) => _startLongPress() : null, - onTapUp: _isThumbsUp ? (details) => _cancelLongPress() : null, - onTapCancel: _isThumbsUp ? () => _cancelLongPress(true) : null, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Stack( - clipBehavior: Clip.none, - alignment: Alignment.center, - children: [ - if (widget.needAnim && !_hideCircle) - CustomPaint( - size: const Size(28, 28), - painter: _ArcPainter( - color: theme.colorScheme.primary, - sweepAngle: _animation!.value, + child: Material( + type: MaterialType.transparency, + child: InkWell( + borderRadius: const BorderRadius.all(Radius.circular(6)), + onTap: _isThumbsUp + ? null + : () { + feedBack(); + widget.onTap?.call(); + }, + onLongPress: _isThumbsUp ? null : widget.onLongPress, + onTapDown: _isThumbsUp ? (details) => _startLongPress() : null, + onTapUp: _isThumbsUp ? (details) => _cancelLongPress() : null, + onTapCancel: _isThumbsUp ? () => _cancelLongPress(true) : null, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Stack( + clipBehavior: Clip.none, + alignment: Alignment.center, + children: [ + if (widget.needAnim && !_hideCircle) + CustomPaint( + size: const Size(28, 28), + painter: _ArcPainter( + color: theme.colorScheme.primary, + sweepAngle: _animation!.value, + ), + ) + else + const SizedBox(width: 28, height: 28), + Icon( + widget.selectStatus + ? widget.selectIcon!.icon! + : widget.icon.icon, + size: 18, + color: widget.selectStatus + ? theme.colorScheme.primary + : widget.icon.color ?? theme.colorScheme.outline, + ), + ], + ), + if (widget.text != null) + AnimatedOpacity( + opacity: widget.isLoading! ? 0 : 1, + duration: const Duration(milliseconds: 200), + child: AnimatedSwitcher( + duration: const Duration(milliseconds: 300), + transitionBuilder: + (Widget child, Animation animation) { + return ScaleTransition(scale: animation, child: child); + }, + child: Text( + widget.text!, + key: ValueKey(widget.text!), + style: TextStyle( + color: widget.selectStatus + ? theme.colorScheme.primary + : theme.colorScheme.outline, + fontSize: theme.textTheme.labelSmall!.fontSize, + ), + semanticsLabel: "", ), - ) - else - const SizedBox(width: 28, height: 28), - Icon( - widget.selectStatus - ? widget.selectIcon!.icon! - : widget.icon.icon, - size: 18, - color: widget.selectStatus - ? theme.colorScheme.primary - : widget.icon.color ?? theme.colorScheme.outline, - ), - ], - ), - if (widget.text != null) - AnimatedOpacity( - opacity: widget.isLoading! ? 0 : 1, - duration: const Duration(milliseconds: 200), - child: AnimatedSwitcher( - duration: const Duration(milliseconds: 300), - transitionBuilder: - (Widget child, Animation animation) { - return ScaleTransition(scale: animation, child: child); - }, - child: Text( - widget.text!, - key: ValueKey(widget.text!), - style: TextStyle( - color: widget.selectStatus - ? theme.colorScheme.primary - : theme.colorScheme.outline, - fontSize: theme.textTheme.labelSmall!.fontSize, - ), - semanticsLabel: "", ), ), - ), - ], + ], + ), ), ), ); diff --git a/lib/pages/video/introduction/ugc/widgets/action_row_item.dart b/lib/pages/video/introduction/ugc/widgets/action_row_item.dart deleted file mode 100644 index 45dae1d1..00000000 --- a/lib/pages/video/introduction/ugc/widgets/action_row_item.dart +++ /dev/null @@ -1,79 +0,0 @@ -import 'package:PiliPlus/utils/feed_back.dart'; -import 'package:flutter/material.dart'; - -class ActionRowItem extends StatelessWidget { - final Icon? icon; - final Icon? selectIcon; - final Function? onTap; - final bool? isLoading; - final String? text; - final bool selectStatus; - final Function? onLongPress; - - const ActionRowItem({ - super.key, - this.icon, - this.selectIcon, - this.onTap, - this.isLoading, - this.text, - this.selectStatus = false, - this.onLongPress, - }); - - @override - Widget build(BuildContext context) { - final theme = Theme.of(context); - return Material( - color: selectStatus - ? theme.colorScheme.primaryContainer.withValues(alpha: 0.6) - : theme.highlightColor.withValues(alpha: 0.2), - borderRadius: const BorderRadius.all(Radius.circular(30)), - clipBehavior: Clip.hardEdge, - child: InkWell( - onTap: () => { - feedBack(), - onTap?.call(), - }, - onLongPress: () { - feedBack(); - onLongPress?.call(); - }, - child: Padding( - padding: const EdgeInsets.fromLTRB(15, 7, 15, 7), - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - if (icon != null) ...[ - Icon(icon!.icon!, - size: 13, - color: selectStatus - ? theme.colorScheme.primary - : theme.colorScheme.onSecondaryContainer), - const SizedBox(width: 6), - ], - AnimatedOpacity( - opacity: isLoading! ? 0 : 1, - duration: const Duration(milliseconds: 200), - child: AnimatedSwitcher( - duration: const Duration(milliseconds: 300), - transitionBuilder: - (Widget child, Animation animation) { - return ScaleTransition(scale: animation, child: child); - }, - child: Text( - text ?? '', - key: ValueKey(text ?? ''), - style: TextStyle( - color: selectStatus ? theme.colorScheme.primary : null, - fontSize: theme.textTheme.labelMedium!.fontSize), - ), - ), - ), - ], - ), - ), - ), - ); - } -} diff --git a/lib/pages/video/introduction/ugc/widgets/menu_row.dart b/lib/pages/video/introduction/ugc/widgets/menu_row.dart index 2051ff4b..0e687f58 100644 --- a/lib/pages/video/introduction/ugc/widgets/menu_row.dart +++ b/lib/pages/video/introduction/ugc/widgets/menu_row.dart @@ -1,102 +1,6 @@ import 'package:PiliPlus/utils/feed_back.dart'; import 'package:flutter/material.dart'; -class MenuRow extends StatelessWidget { - const MenuRow({ - super.key, - this.isLoading, - }); - final bool? isLoading; - - @override - Widget build(BuildContext context) { - final theme = Theme.of(context); - return Container( - width: double.infinity, - color: theme.colorScheme.surface, - padding: const EdgeInsets.only(top: 9, bottom: 9, left: 12), - child: SingleChildScrollView( - scrollDirection: Axis.horizontal, - child: Row(children: [ - ActionRowLineItem( - onTap: () => {}, - isLoading: isLoading, - text: '推荐', - selectStatus: false, - ), - const SizedBox(width: 8), - ActionRowLineItem( - onTap: () => {}, - isLoading: isLoading, - text: '弹幕', - selectStatus: false, - ), - const SizedBox(width: 8), - ActionRowLineItem( - onTap: () => {}, - isLoading: isLoading, - text: '评论列表', - selectStatus: false, - ), - const SizedBox(width: 8), - ActionRowLineItem( - onTap: () => {}, - isLoading: isLoading, - text: '播放列表', - selectStatus: false, - ), - ]), - ), - ); - } - - Widget actionRowLineItem( - ThemeData theme, Function? onTap, bool? isLoading, String? text, - {bool selectStatus = false}) { - return Material( - color: selectStatus - ? theme.highlightColor.withValues(alpha: 0.2) - : Colors.transparent, - borderRadius: const BorderRadius.all(Radius.circular(30)), - clipBehavior: Clip.hardEdge, - child: InkWell( - onTap: () => { - feedBack(), - onTap?.call(), - }, - child: Container( - padding: const EdgeInsets.fromLTRB(13, 5.5, 13, 4.5), - decoration: BoxDecoration( - borderRadius: const BorderRadius.all(Radius.circular(30)), - border: Border.all( - color: selectStatus - ? Colors.transparent - : theme.highlightColor.withValues(alpha: 0.2), - ), - ), - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - AnimatedOpacity( - opacity: isLoading! ? 0 : 1, - duration: const Duration(milliseconds: 200), - child: Text( - text!, - style: TextStyle( - fontSize: 13, - color: selectStatus - ? theme.colorScheme.onSurface - : theme.colorScheme.outline), - ), - ), - ], - ), - ), - ), - ); - } -} - class ActionRowLineItem extends StatelessWidget { const ActionRowLineItem({ super.key, @@ -118,12 +22,11 @@ class ActionRowLineItem extends StatelessWidget { Widget build(BuildContext context) { final theme = Theme.of(context); return Material( - color: selectStatus - ? theme.colorScheme.secondaryContainer - : Colors.transparent, + color: selectStatus ? theme.colorScheme.secondaryContainer : null, + type: selectStatus ? MaterialType.canvas : MaterialType.transparency, borderRadius: const BorderRadius.all(Radius.circular(30)), - clipBehavior: Clip.hardEdge, child: InkWell( + borderRadius: const BorderRadius.all(Radius.circular(30)), onTap: () => { feedBack(), onTap?.call(), diff --git a/lib/pages/video/introduction/ugc/widgets/page.dart b/lib/pages/video/introduction/ugc/widgets/page.dart index c2f8d40a..dbaaaceb 100644 --- a/lib/pages/video/introduction/ugc/widgets/page.dart +++ b/lib/pages/video/introduction/ugc/widgets/page.dart @@ -147,8 +147,8 @@ class _PagesPanelState extends State { child: Material( color: theme.colorScheme.onInverseSurface, borderRadius: const BorderRadius.all(Radius.circular(6)), - clipBehavior: Clip.hardEdge, child: InkWell( + borderRadius: const BorderRadius.all(Radius.circular(6)), onTap: () { if (widget.showEpisodes == null) { Get.back(); diff --git a/lib/pages/video/introduction/ugc/widgets/season.dart b/lib/pages/video/introduction/ugc/widgets/season.dart index 9959d8b5..1b5893af 100644 --- a/lib/pages/video/introduction/ugc/widgets/season.dart +++ b/lib/pages/video/introduction/ugc/widgets/season.dart @@ -90,68 +90,66 @@ class _SeasonPanelState extends State { return const SizedBox.shrink(); } final theme = Theme.of(context); - return Builder(builder: (BuildContext context) { - return Container( - margin: const EdgeInsets.only( - top: 8, - left: 2, - right: 2, - ), - child: Material( - color: theme.colorScheme.onInverseSurface, + return Padding( + padding: const EdgeInsets.only( + top: 8, + left: 2, + right: 2, + ), + child: Material( + color: theme.colorScheme.onInverseSurface, + borderRadius: const BorderRadius.all(Radius.circular(6)), + child: InkWell( borderRadius: const BorderRadius.all(Radius.circular(6)), - clipBehavior: Clip.hardEdge, - child: InkWell( - onTap: widget.onTap == false - ? null - : () => widget.showEpisodes( - _videoDetailController.seasonIndex.value, - videoDetail.ugcSeason, - null, - _videoDetailController.bvid, - null, - _videoDetailController.seasonCid, - ), - child: Padding( - padding: const EdgeInsets.fromLTRB(8, 12, 8, 12), - child: Row( - children: [ - Expanded( - child: Text( - '合集:${videoDetail.ugcSeason!.title!}', - style: theme.textTheme.labelMedium, - overflow: TextOverflow.ellipsis, - ), + onTap: widget.onTap == false + ? null + : () => widget.showEpisodes( + _videoDetailController.seasonIndex.value, + videoDetail.ugcSeason, + null, + _videoDetailController.bvid, + null, + _videoDetailController.seasonCid, ), - const SizedBox(width: 15), - Image.asset( - 'assets/images/live.png', - color: theme.colorScheme.primary, - height: 12, - semanticLabel: "正在播放:", + child: Padding( + padding: const EdgeInsets.fromLTRB(8, 12, 8, 12), + child: Row( + children: [ + Expanded( + child: Text( + '合集:${videoDetail.ugcSeason!.title!}', + style: theme.textTheme.labelMedium, + overflow: TextOverflow.ellipsis, ), - const SizedBox(width: 10), - Obx( - () => Text( - '${currentIndex.value + 1}/${episodes.length}', - style: theme.textTheme.labelMedium, - semanticsLabel: - '第${currentIndex.value + 1}集,共${episodes.length}集', - ), + ), + const SizedBox(width: 15), + Image.asset( + 'assets/images/live.png', + color: theme.colorScheme.primary, + height: 12, + semanticLabel: "正在播放:", + ), + const SizedBox(width: 10), + Obx( + () => Text( + '${currentIndex.value + 1}/${episodes.length}', + style: theme.textTheme.labelMedium, + semanticsLabel: + '第${currentIndex.value + 1}集,共${episodes.length}集', ), - const SizedBox(width: 6), - const Icon( - Icons.arrow_forward_ios_outlined, - size: 13, - semanticLabel: '查看', - ) - ], - ), + ), + const SizedBox(width: 6), + const Icon( + Icons.arrow_forward_ios_outlined, + size: 13, + semanticLabel: '查看', + ) + ], ), ), ), - ); - }); + ), + ); } void _findEpisode() { diff --git a/lib/pages/video/medialist/view.dart b/lib/pages/video/medialist/view.dart index 123dc7ed..df92f904 100644 --- a/lib/pages/video/medialist/view.dart +++ b/lib/pages/video/medialist/view.dart @@ -90,6 +90,7 @@ class _MediaListPanelState automaticallyImplyLeading: false, titleSpacing: 16, title: Text(widget.panelTitle ?? '稍后再看'), + backgroundColor: Colors.transparent, actions: [ Obx( () => mediumButton( @@ -155,158 +156,163 @@ class _MediaListPanelState final isCurr = item.bvid == widget.getBvId(); return SizedBox( height: 98, - child: InkWell( - onTap: () async { - if (item.type != 2) { - SmartDialog.showToast('不支持播放该类型视频'); - return; - } - Get.back(); - String bvid = item.bvid!; - int? aid = item.aid; - String cover = item.cover ?? ''; - final int? cid = - item.cid ?? await SearchHttp.ab2c(aid: aid, bvid: bvid); - if (cid != null) { - widget.changeMediaList?.call(bvid, cid, aid, cover); - } - }, - onLongPress: () => imageSaveDialog( - title: item.title, - cover: item.cover, - aid: item.aid, - bvid: item.bvid, - ), - child: Stack( - clipBehavior: Clip.none, - children: [ - Padding( - padding: const EdgeInsets.symmetric( - horizontal: 12, - vertical: 5, - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AspectRatio( - aspectRatio: StyleString.aspectRatio, - child: LayoutBuilder( - builder: (context, boxConstraints) { - return Stack( - clipBehavior: Clip.none, - children: [ - NetworkImgLayer( - src: item.cover, - width: boxConstraints.maxWidth, - height: boxConstraints.maxHeight, - ), - if (item.badge?.text?.isNotEmpty == true) - PBadge( - text: item.badge?.text, - right: 6.0, - top: 6.0, - type: switch (item.badge?.text) { - '充电专属' => PBadgeType.error, - _ => PBadgeType.primary, - }, + child: Material( + type: MaterialType.transparency, + child: InkWell( + onTap: () async { + if (item.type != 2) { + SmartDialog.showToast('不支持播放该类型视频'); + return; + } + Get.back(); + String bvid = item.bvid!; + int? aid = item.aid; + String cover = item.cover ?? ''; + final int? cid = item.cid ?? + await SearchHttp.ab2c(aid: aid, bvid: bvid); + if (cid != null) { + widget.changeMediaList?.call(bvid, cid, aid, cover); + } + }, + onLongPress: () => imageSaveDialog( + title: item.title, + cover: item.cover, + aid: item.aid, + bvid: item.bvid, + ), + child: Stack( + clipBehavior: Clip.none, + children: [ + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 12, + vertical: 5, + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AspectRatio( + aspectRatio: StyleString.aspectRatio, + child: LayoutBuilder( + builder: (context, boxConstraints) { + return Stack( + clipBehavior: Clip.none, + children: [ + NetworkImgLayer( + src: item.cover, + width: boxConstraints.maxWidth, + height: boxConstraints.maxHeight, ), - PBadge( - text: Utils.timeFormat(item.duration!), - right: 6.0, - bottom: 6.0, - type: PBadgeType.gray, - ), - ], - ); - }, + if (item.badge?.text?.isNotEmpty == + true) + PBadge( + text: item.badge?.text, + right: 6.0, + top: 6.0, + type: switch (item.badge?.text) { + '充电专属' => PBadgeType.error, + _ => PBadgeType.primary, + }, + ), + PBadge( + text: + Utils.timeFormat(item.duration!), + right: 6.0, + bottom: 6.0, + type: PBadgeType.gray, + ), + ], + ); + }, + ), ), - ), - const SizedBox(width: 10), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - item.title!, - maxLines: 2, - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontWeight: - isCurr ? FontWeight.bold : null, - color: isCurr - ? theme.colorScheme.primary - : null, - ), - ), - if (item.type == 24 && - item.intro?.isNotEmpty == true) ...[ - const SizedBox(height: 3), + const SizedBox(width: 10), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ Text( - item.intro!, + item.title!, maxLines: 2, overflow: TextOverflow.ellipsis, style: TextStyle( - fontSize: 13, + fontWeight: + isCurr ? FontWeight.bold : null, + color: isCurr + ? theme.colorScheme.primary + : null, + ), + ), + if (item.type == 24 && + item.intro?.isNotEmpty == true) ...[ + const SizedBox(height: 3), + Text( + item.intro!, + maxLines: 2, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 13, + color: theme.colorScheme.outline, + ), + ), + ], + const Spacer(), + Text( + item.upper!.name!, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 12, color: theme.colorScheme.outline, ), ), + if (item.type == 2) ...[ + const SizedBox(height: 3), + Row( + spacing: 8, + children: [ + StatWidget( + type: StatType.play, + value: item.cntInfo!.play, + ), + StatWidget( + type: StatType.danmaku, + value: item.cntInfo!.danmaku, + ), + ], + ), + ], ], - const Spacer(), - Text( - item.upper!.name!, - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontSize: 12, - color: theme.colorScheme.outline, - ), - ), - if (item.type == 2) ...[ - const SizedBox(height: 3), - Row( - spacing: 8, - children: [ - StatWidget( - type: StatType.play, - value: item.cntInfo!.play, - ), - StatWidget( - type: StatType.danmaku, - value: item.cntInfo!.danmaku, - ), - ], - ), - ], - ], + ), ), - ), - ], + ], + ), ), - ), - if (showDelBtn && !isCurr) - Positioned( - right: 12, - bottom: -6, - child: InkWell( - customBorder: const CircleBorder(), - onTap: () => showConfirmDialog( - context: context, - title: '确定移除该视频?', - onConfirm: () => widget.onDelete!(index), - ), - onLongPress: () => widget.onDelete!(index), - child: Padding( - padding: const EdgeInsets.all(9), - child: Icon( - Icons.clear, - size: 18, - color: theme.colorScheme.outline, + if (showDelBtn && !isCurr) + Positioned( + right: 12, + bottom: -6, + child: InkWell( + customBorder: const CircleBorder(), + onTap: () => showConfirmDialog( + context: context, + title: '确定移除该视频?', + onConfirm: () => widget.onDelete!(index), + ), + onLongPress: () => widget.onDelete!(index), + child: Padding( + padding: const EdgeInsets.all(9), + child: Icon( + Icons.clear, + size: 18, + color: theme.colorScheme.outline, + ), ), ), ), - ), - ], + ], + ), ), ), ); diff --git a/lib/pages/video/member/view.dart b/lib/pages/video/member/view.dart index 1a21931d..42ae5d59 100644 --- a/lib/pages/video/member/view.dart +++ b/lib/pages/video/member/view.dart @@ -190,26 +190,23 @@ class _HorizontalMemberPageState extends State { _controller.onLoadMore(); } final SpaceArchiveItem videoItem = response[index]; - return Material( - color: Colors.transparent, - child: VideoCardHMemberVideo( - videoItem: videoItem, - bvid: _bvid, - onTap: () { - final status = - widget.videoIntroController.changeSeasonOrbangu( - null, - videoItem.bvid, - videoItem.cid, - IdUtils.bv2av(videoItem.bvid!), - videoItem.cover, - ); - if (status) { - _bvid = videoItem.bvid; - setState(() {}); - } - }, - ), + return VideoCardHMemberVideo( + videoItem: videoItem, + bvid: _bvid, + onTap: () { + final status = + widget.videoIntroController.changeSeasonOrbangu( + null, + videoItem.bvid, + videoItem.cid, + IdUtils.bv2av(videoItem.bvid!), + videoItem.cover, + ); + if (status) { + _bvid = videoItem.bvid; + setState(() {}); + } + }, ); }, childCount: response!.length, @@ -387,22 +384,19 @@ class _HorizontalMemberPageState extends State { ); } - Hero _buildAvatar(String face) => Hero( - tag: face, - child: GestureDetector( - onTap: () { - widget.videoDetailController.onViewImage(); - context.imageView( - imgList: [SourceModel(url: face)], - onDismissed: widget.videoDetailController.onDismissed, - ); - }, - child: NetworkImgLayer( - src: face, - type: ImageType.avatar, - width: 70, - height: 70, - ), + Widget _buildAvatar(String face) => GestureDetector( + onTap: () { + widget.videoDetailController.onViewImage(); + context.imageView( + imgList: [SourceModel(url: face)], + onDismissed: widget.videoDetailController.onDismissed, + ); + }, + child: NetworkImgLayer( + src: face, + type: ImageType.avatar, + width: 70, + height: 70, ), ); } diff --git a/lib/pages/video/note/view.dart b/lib/pages/video/note/view.dart index f30fb979..29b95228 100644 --- a/lib/pages/video/note/view.dart +++ b/lib/pages/video/note/view.dart @@ -63,6 +63,7 @@ class _NoteListPageState extends CommonSlidePageState { automaticallyImplyLeading: false, titleSpacing: 16, toolbarHeight: 45, + backgroundColor: Colors.transparent, title: Obx( () => Text( '笔记${_controller.count.value == -1 ? '' : '(${_controller.count.value})'}'), @@ -195,88 +196,92 @@ class _NoteListPageState extends CommonSlidePageState { } Widget _itemWidget(ThemeData theme, VideoNoteItemModel item) { - return InkWell( - onTap: () => Get.toNamed( - '/articlePage', - parameters: { - 'id': item.cvid!.toString(), - 'type': 'read', - }, - ), - child: Padding( - padding: const EdgeInsets.all(12), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - GestureDetector( - onTap: () => Get.toNamed('/member?mid=${item.author!.mid}'), - child: NetworkImgLayer( - height: 34, - width: 34, - src: item.author!.face, - type: ImageType.avatar, + return Material( + type: MaterialType.transparency, + child: InkWell( + onTap: () => Get.toNamed( + '/articlePage', + parameters: { + 'id': item.cvid!.toString(), + 'type': 'read', + }, + ), + child: Padding( + padding: const EdgeInsets.all(12), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + GestureDetector( + onTap: () => Get.toNamed('/member?mid=${item.author!.mid}'), + child: NetworkImgLayer( + height: 34, + width: 34, + src: item.author!.face, + type: ImageType.avatar, + ), ), - ), - const SizedBox(width: 12), - Expanded( - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - GestureDetector( - onTap: () => Get.toNamed('/member?mid=${item.author!.mid}'), - child: Row( - children: [ - Text( - item.author!.name!, - style: TextStyle( - color: item.author?.vipInfo?.status != null && - item.author!.vipInfo!.status > 0 && - item.author!.vipInfo!.type == 2 - ? context.vipColor - : theme.colorScheme.outline, - fontSize: 13, + const SizedBox(width: 12), + Expanded( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + GestureDetector( + onTap: () => + Get.toNamed('/member?mid=${item.author!.mid}'), + child: Row( + children: [ + Text( + item.author!.name!, + style: TextStyle( + color: item.author?.vipInfo?.status != null && + item.author!.vipInfo!.status > 0 && + item.author!.vipInfo!.type == 2 + ? context.vipColor + : theme.colorScheme.outline, + fontSize: 13, + ), ), + const SizedBox(width: 6), + Image.asset( + 'assets/images/lv/lv${item.author!.isSeniorMember == 1 ? '6_s' : item.author!.level}.png', + height: 11, + ), + ], + ), + ), + const SizedBox(height: 4), + if (item.pubtime != null) + Text( + item.pubtime!, + style: TextStyle( + color: theme.colorScheme.outline, + fontSize: 12, ), - const SizedBox(width: 6), - Image.asset( - 'assets/images/lv/lv${item.author!.isSeniorMember == 1 ? '6_s' : item.author!.level}.png', - height: 11, + ), + if (item.summary != null) ...[ + const SizedBox(height: 5), + Text( + item.summary!, + style: TextStyle( + height: 1.75, + fontSize: theme.textTheme.bodyMedium!.fontSize, ), - ], - ), - ), - const SizedBox(height: 4), - if (item.pubtime != null) - Text( - item.pubtime!, - style: TextStyle( - color: theme.colorScheme.outline, - fontSize: 12, ), - ), - if (item.summary != null) ...[ - const SizedBox(height: 5), - Text( - item.summary!, - style: TextStyle( - height: 1.75, - fontSize: theme.textTheme.bodyMedium!.fontSize, + Text( + '查看全部', + style: TextStyle( + color: theme.colorScheme.primary, + height: 1.75, + fontSize: theme.textTheme.bodyMedium!.fontSize, + ), ), - ), - Text( - '查看全部', - style: TextStyle( - color: theme.colorScheme.primary, - height: 1.75, - fontSize: theme.textTheme.bodyMedium!.fontSize, - ), - ), + ], ], - ], + ), ), - ), - ], + ], + ), ), ), ); diff --git a/lib/pages/video/reply/widgets/reply_item_grpc.dart b/lib/pages/video/reply/widgets/reply_item_grpc.dart index 3901ffb0..b2d41673 100644 --- a/lib/pages/video/reply/widgets/reply_item_grpc.dart +++ b/lib/pages/video/reply/widgets/reply_item_grpc.dart @@ -74,7 +74,7 @@ class ReplyItemGrpc extends StatelessWidget { Widget build(BuildContext context) { final ThemeData theme = Theme.of(context); return Material( - color: Colors.transparent, + type: MaterialType.transparency, child: InkWell( onTap: () { feedBack(); diff --git a/lib/pages/video/view.dart b/lib/pages/video/view.dart index 89ccf790..d1dec15f 100644 --- a/lib/pages/video/view.dart +++ b/lib/pages/video/view.dart @@ -1731,84 +1731,78 @@ class _VideoDetailPageVState extends State Widget videoIntro([bool needRelated = true, bool needCtr = true]) { final bottom = MediaQuery.paddingOf(context).bottom; - Widget introPanel() => Scaffold( - resizeToAvoidBottomInset: false, - backgroundColor: Colors.transparent, - body: CustomScrollView( - key: const PageStorageKey('简介'), - controller: needCtr ? _introController : null, - physics: !needCtr - ? const AlwaysScrollableScrollPhysics( - parent: ClampingScrollPhysics()) - : null, - slivers: [ - if (videoDetailController.videoType == SearchType.video) ...[ - VideoIntroPanel( - key: ugcPanelKey, + Widget introPanel() => CustomScrollView( + key: const PageStorageKey('简介'), + controller: needCtr ? _introController : null, + physics: !needCtr + ? const AlwaysScrollableScrollPhysics( + parent: ClampingScrollPhysics()) + : null, + slivers: [ + if (videoDetailController.videoType == SearchType.video) ...[ + VideoIntroPanel( + key: ugcPanelKey, + heroTag: heroTag, + showAiBottomSheet: showAiBottomSheet, + showEpisodes: showEpisodes, + onShowMemberPage: onShowMemberPage, + ), + if (needRelated && + videoDetailController + .plPlayerController.showRelatedVideo) ...[ + SliverToBoxAdapter( + child: Padding( + padding: const EdgeInsets.only(top: StyleString.safeSpace), + child: Divider( + height: 1, + indent: 12, + endIndent: 12, + color: + themeData.colorScheme.outline.withValues(alpha: 0.08), + ), + ), + ), + RelatedVideoPanel(key: relatedVideoPanelKey, heroTag: heroTag), + ] else + SliverToBoxAdapter( + child: SizedBox( + height: bottom + StyleString.safeSpace, + ), + ), + ] else if (videoDetailController.videoType == + SearchType.media_bangumi) + Obx( + () => PgcIntroPage( + key: pgcPanelKey, heroTag: heroTag, - showAiBottomSheet: showAiBottomSheet, + cid: videoDetailController.cid.value, showEpisodes: showEpisodes, - onShowMemberPage: onShowMemberPage, + showIntroDetail: showIntroDetail, ), - if (needRelated && - videoDetailController - .plPlayerController.showRelatedVideo) ...[ - SliverToBoxAdapter( - child: Padding( - padding: - const EdgeInsets.only(top: StyleString.safeSpace), - child: Divider( - height: 1, - indent: 12, - endIndent: 12, - color: themeData.colorScheme.outline - .withValues(alpha: 0.08), - ), - ), - ), - RelatedVideoPanel( - key: relatedVideoPanelKey, heroTag: heroTag), - ] else - SliverToBoxAdapter( - child: SizedBox( - height: bottom + StyleString.safeSpace, - ), - ), - ] else if (videoDetailController.videoType == - SearchType.media_bangumi) - Obx( - () => PgcIntroPage( - key: pgcPanelKey, - heroTag: heroTag, - cid: videoDetailController.cid.value, - showEpisodes: showEpisodes, - showIntroDetail: showIntroDetail, - ), - ), - SliverToBoxAdapter( - child: SizedBox( - height: bottom + - (videoDetailController.isPlayAll && - MediaQuery.orientationOf(context) == - Orientation.landscape - ? 75 - : 0), - ), - ) - ], - ), + ), + SliverToBoxAdapter( + child: SizedBox( + height: bottom + + (videoDetailController.isPlayAll && + MediaQuery.orientationOf(context) == + Orientation.landscape + ? 75 + : 0), + ), + ) + ], ); - if (videoDetailController.isPlayAll) { - return Stack( - clipBehavior: Clip.none, - children: [ - introPanel(), + return Stack( + clipBehavior: Clip.none, + children: [ + introPanel(), + if (videoDetailController.isPlayAll) Positioned( left: 12, right: 12, bottom: bottom + 12, child: Material( - color: Colors.transparent, + type: MaterialType.transparency, child: InkWell( onTap: () => videoDetailController.showMediaListPanel(context), borderRadius: const BorderRadius.all(Radius.circular(14)), @@ -1839,12 +1833,11 @@ class _VideoDetailPageVState extends State ), ), ), - ), - ], - ); - } else { - return introPanel(); - } + ) + else + const SizedBox.shrink(), + ], + ); } Widget get seasonPanel => Column( diff --git a/lib/pages/video/widgets/header_control.dart b/lib/pages/video/widgets/header_control.dart index 4f96f481..943d594b 100644 --- a/lib/pages/video/widgets/header_control.dart +++ b/lib/pages/video/widgets/header_control.dart @@ -4,7 +4,6 @@ import 'dart:math'; import 'package:PiliPlus/common/widgets/button/icon_button.dart'; import 'package:PiliPlus/common/widgets/custom_icon.dart'; -import 'package:PiliPlus/common/widgets/self_sized_horizontal_list.dart'; import 'package:PiliPlus/models/common/search_type.dart'; import 'package:PiliPlus/models/common/super_resolution_type.dart'; import 'package:PiliPlus/models/common/video/audio_quality.dart'; @@ -125,9 +124,8 @@ class HeaderControlState extends State { color: theme.colorScheme.surface, borderRadius: const BorderRadius.all(Radius.circular(12)), child: ListView( - padding: EdgeInsets.zero, + padding: const EdgeInsets.symmetric(vertical: 14), children: [ - const SizedBox(height: 14), ListTile( dense: true, onTap: () { @@ -272,66 +270,64 @@ class HeaderControlState extends State { } }, ), - SelfSizedHorizontalList( - itemCount: 4, - gapSize: 10, + SingleChildScrollView( + scrollDirection: Axis.horizontal, padding: const EdgeInsets.symmetric(horizontal: 16), - childBuilder: (index) { - return switch (index) { - 0 => Obx( - () => ActionRowLineItem( - iconData: Icons.flip, - onTap: () => widget.controller.flipX.value = - !widget.controller.flipX.value, - text: " 左右翻转 ", - selectStatus: widget.controller.flipX.value, - ), + child: Row( + spacing: 10, + children: [ + Obx( + () => ActionRowLineItem( + iconData: Icons.flip, + onTap: () => widget.controller.flipX.value = + !widget.controller.flipX.value, + text: " 左右翻转 ", + selectStatus: widget.controller.flipX.value, ), - 1 => Obx( - () => ActionRowLineItem( - icon: Transform.rotate( - angle: pi / 2, - child: Icon( - Icons.flip, - size: 13, - color: widget.controller.flipY.value - ? theme.colorScheme.onSecondaryContainer - : theme.colorScheme.outline, - ), + ), + Obx( + () => ActionRowLineItem( + icon: Transform.rotate( + angle: pi / 2, + child: Icon( + Icons.flip, + size: 13, + color: widget.controller.flipY.value + ? theme.colorScheme.onSecondaryContainer + : theme.colorScheme.outline, ), - onTap: () { - widget.controller.flipY.value = - !widget.controller.flipY.value; - }, - text: " 上下翻转 ", - selectStatus: widget.controller.flipY.value, ), + onTap: () { + widget.controller.flipY.value = + !widget.controller.flipY.value; + }, + text: " 上下翻转 ", + selectStatus: widget.controller.flipY.value, ), - 2 => Obx( - () => ActionRowLineItem( - iconData: Icons.headphones, - onTap: () { - widget.controller.onlyPlayAudio.value = - !widget.controller.onlyPlayAudio.value; - widget.videoDetailCtr.playerInit(); - }, - text: " 听视频 ", - selectStatus: widget.controller.onlyPlayAudio.value, - ), + ), + Obx( + () => ActionRowLineItem( + iconData: Icons.headphones, + onTap: () { + widget.controller.onlyPlayAudio.value = + !widget.controller.onlyPlayAudio.value; + widget.videoDetailCtr.playerInit(); + }, + text: " 听视频 ", + selectStatus: widget.controller.onlyPlayAudio.value, ), - 3 => Obx( - () => ActionRowLineItem( - iconData: Icons.play_circle_outline, - onTap: - widget.controller.setContinuePlayInBackground, - text: " 后台播放 ", - selectStatus: widget - .controller.continuePlayInBackground.value, - ), + ), + Obx( + () => ActionRowLineItem( + iconData: Icons.play_circle_outline, + onTap: widget.controller.setContinuePlayInBackground, + text: " 后台播放 ", + selectStatus: + widget.controller.continuePlayInBackground.value, ), - _ => throw UnimplementedError(), - }; - }, + ), + ], + ), ), ListTile( dense: true, @@ -536,7 +532,6 @@ class HeaderControlState extends State { leading: const Icon(Icons.error_outline, size: 20), title: const Text('举报', style: titleStyle), ), - const SizedBox(height: 14), ], ), ), @@ -578,7 +573,8 @@ class HeaderControlState extends State { clipBehavior: Clip.hardEdge, color: theme.colorScheme.surface, borderRadius: const BorderRadius.all(Radius.circular(12)), - child: Column( + child: ListView( + padding: EdgeInsets.zero, children: [ SizedBox( height: 45, @@ -599,77 +595,59 @@ class HeaderControlState extends State { ), ), ), - Expanded( - child: Material( - color: Colors.transparent, - child: Scrollbar( - child: ListView( - padding: EdgeInsets.zero, - children: [ - for (int i = 0; i < totalQaSam; i++) ...[ - ListTile( - dense: true, - onTap: () async { - if (currentVideoQa.code == - videoFormat[i].quality) { - return; - } - Get.back(); - final int quality = videoFormat[i].quality!; - videoDetailCtr - ..currentVideoQa = - VideoQuality.fromCode(quality) - ..updatePlayer(); + for (int i = 0; i < totalQaSam; i++) ...[ + ListTile( + dense: true, + onTap: () async { + if (currentVideoQa.code == videoFormat[i].quality) { + return; + } + Get.back(); + final int quality = videoFormat[i].quality!; + videoDetailCtr + ..currentVideoQa = VideoQuality.fromCode(quality) + ..updatePlayer(); - // update - late String oldQualityDesc; - await Connectivity() - .checkConnectivity() - .then((res) { - if (res.contains(ConnectivityResult.wifi)) { - oldQualityDesc = VideoQuality.fromCode( - GStorage.defaultVideoQa) - .description; - setting.put( - SettingBoxKey.defaultVideoQa, - quality, - ); - } else { - oldQualityDesc = VideoQuality.fromCode( - GStorage.defaultVideoQaCellular) - .description; - setting.put( - SettingBoxKey.defaultVideoQaCellular, - quality, - ); - } - }); - SmartDialog.showToast( - "默认画质由:$oldQualityDesc 变为:${VideoQuality.fromCode(quality).description}", - ); - }, - // 可能包含会员解锁画质 - enabled: i >= totalQaSam - userfulQaSam, - contentPadding: - const EdgeInsets.only(left: 20, right: 20), - title: Text(videoFormat[i].newDesc!), - trailing: - currentVideoQa.code == videoFormat[i].quality - ? Icon( - Icons.done, - color: theme.colorScheme.primary, - ) - : Text( - videoFormat[i].format!, - style: subTitleStyle, - ), - ), - ] - ], - ), - ), + // update + late String oldQualityDesc; + await Connectivity().checkConnectivity().then((res) { + if (res.contains(ConnectivityResult.wifi)) { + oldQualityDesc = + VideoQuality.fromCode(GStorage.defaultVideoQa) + .description; + setting.put( + SettingBoxKey.defaultVideoQa, + quality, + ); + } else { + oldQualityDesc = VideoQuality.fromCode( + GStorage.defaultVideoQaCellular) + .description; + setting.put( + SettingBoxKey.defaultVideoQaCellular, + quality, + ); + } + }); + SmartDialog.showToast( + "默认画质由:$oldQualityDesc 变为:${VideoQuality.fromCode(quality).description}", + ); + }, + // 可能包含会员解锁画质 + enabled: i >= totalQaSam - userfulQaSam, + contentPadding: const EdgeInsets.only(left: 20, right: 20), + title: Text(videoFormat[i].newDesc!), + trailing: currentVideoQa.code == videoFormat[i].quality + ? Icon( + Icons.done, + color: theme.colorScheme.primary, + ) + : Text( + videoFormat[i].format!, + style: subTitleStyle, + ), ), - ), + ] ], ), ), @@ -691,77 +669,67 @@ class HeaderControlState extends State { clipBehavior: Clip.hardEdge, color: theme.colorScheme.surface, borderRadius: const BorderRadius.all(Radius.circular(12)), - child: Column( + child: ListView( + padding: EdgeInsets.zero, children: [ const SizedBox( - height: 45, - child: Center(child: Text('选择音质', style: titleStyle))), - Expanded( - child: Material( - color: Colors.transparent, - child: ListView( - padding: EdgeInsets.zero, - children: [ - for (final AudioItem i in audio) ...[ - ListTile( - dense: true, - onTap: () async { - if (currentAudioQa.code == i.id) { - return; - } - Get.back(); - final int quality = i.id!; - videoDetailCtr - ..currentAudioQa = - AudioQuality.fromCode(quality) - ..updatePlayer(); - - // update - late String oldQualityDesc; - await Connectivity() - .checkConnectivity() - .then((res) { - if (res.contains(ConnectivityResult.wifi)) { - oldQualityDesc = AudioQuality.fromCode( - GStorage.defaultAudioQa) - .description; - setting.put( - SettingBoxKey.defaultAudioQa, - quality, - ); - } else { - oldQualityDesc = AudioQuality.fromCode( - GStorage.defaultAudioQaCellular) - .description; - setting.put( - SettingBoxKey.defaultAudioQaCellular, - quality, - ); - } - }); - SmartDialog.showToast( - "默认音质由:$oldQualityDesc 变为:${AudioQuality.fromCode(quality).description}", - ); - }, - contentPadding: - const EdgeInsets.only(left: 20, right: 20), - title: Text(i.quality), - subtitle: Text( - i.codecs!, - style: subTitleStyle, - ), - trailing: currentAudioQa.code == i.id - ? Icon( - Icons.done, - color: theme.colorScheme.primary, - ) - : const SizedBox.shrink(), - ), - ] - ], - ), + height: 45, + child: Center( + child: Text('选择音质', style: titleStyle), ), ), + for (final AudioItem i in audio) ...[ + ListTile( + dense: true, + onTap: () async { + if (currentAudioQa.code == i.id) { + return; + } + Get.back(); + final int quality = i.id!; + videoDetailCtr + ..currentAudioQa = AudioQuality.fromCode(quality) + ..updatePlayer(); + + // update + late String oldQualityDesc; + await Connectivity().checkConnectivity().then((res) { + if (res.contains(ConnectivityResult.wifi)) { + oldQualityDesc = + AudioQuality.fromCode(GStorage.defaultAudioQa) + .description; + setting.put( + SettingBoxKey.defaultAudioQa, + quality, + ); + } else { + oldQualityDesc = AudioQuality.fromCode( + GStorage.defaultAudioQaCellular) + .description; + setting.put( + SettingBoxKey.defaultAudioQaCellular, + quality, + ); + } + }); + SmartDialog.showToast( + "默认音质由:$oldQualityDesc 变为:${AudioQuality.fromCode(quality).description}", + ); + }, + contentPadding: const EdgeInsets.only(left: 20, right: 20), + title: Text(i.quality), + subtitle: Text( + i.codecs!, + style: subTitleStyle, + ), + trailing: currentAudioQa.code == i.id + ? Icon( + Icons.done, + color: theme.colorScheme.primary, + ) + : const SizedBox.shrink(), + ), + ] ], ), ), @@ -798,45 +766,45 @@ class HeaderControlState extends State { child: Column( children: [ const SizedBox( - height: 45, - child: Center(child: Text('选择解码格式', style: titleStyle))), + height: 45, + child: Center( + child: Text('选择解码格式', style: titleStyle), + ), + ), Expanded( - child: Material( - color: Colors.transparent, - child: ListView( - padding: EdgeInsets.zero, - children: [ - for (var i in list) ...[ - ListTile( - dense: true, - onTap: () { - if (i.startsWith(currentDecodeFormats.code)) { - return; - } - videoDetailCtr - ..currentDecodeFormats = - VideoDecodeFormatTypeExt.fromString(i)! - ..updatePlayer(); - Get.back(); - }, - contentPadding: - const EdgeInsets.only(left: 20, right: 20), - title: Text(VideoDecodeFormatTypeExt.fromString(i)! - .description), - subtitle: Text( - i!, - style: subTitleStyle, - ), - trailing: i.startsWith(currentDecodeFormats.code) - ? Icon( - Icons.done, - color: theme.colorScheme.primary, - ) - : const SizedBox.shrink(), + child: ListView( + padding: EdgeInsets.zero, + children: [ + for (var i in list) ...[ + ListTile( + dense: true, + onTap: () { + if (i.startsWith(currentDecodeFormats.code)) { + return; + } + videoDetailCtr + ..currentDecodeFormats = + VideoDecodeFormatTypeExt.fromString(i)! + ..updatePlayer(); + Get.back(); + }, + contentPadding: + const EdgeInsets.only(left: 20, right: 20), + title: Text(VideoDecodeFormatTypeExt.fromString(i)! + .description), + subtitle: Text( + i!, + style: subTitleStyle, ), - ] - ], - ), + trailing: i.startsWith(currentDecodeFormats.code) + ? Icon( + Icons.done, + color: theme.colorScheme.primary, + ) + : const SizedBox.shrink(), + ), + ] + ], ), ), ], @@ -1786,39 +1754,32 @@ class HeaderControlState extends State { clipBehavior: Clip.hardEdge, color: theme.colorScheme.surface, borderRadius: const BorderRadius.all(Radius.circular(12)), - child: Column( + child: ListView( + padding: EdgeInsets.zero, children: [ const SizedBox( - height: 45, - child: Center(child: Text('选择播放顺序', style: titleStyle))), - Expanded( - child: Material( - color: Colors.transparent, - child: ListView( - padding: EdgeInsets.zero, - children: [ - for (final PlayRepeat i in PlayRepeat.values) ...[ - ListTile( - dense: true, - onTap: () { - widget.controller.setPlayRepeat(i); - Get.back(); - }, - contentPadding: - const EdgeInsets.only(left: 20, right: 20), - title: Text(i.description), - trailing: widget.controller.playRepeat == i - ? Icon( - Icons.done, - color: theme.colorScheme.primary, - ) - : const SizedBox.shrink(), - ) - ], - ], - ), + height: 45, + child: Center( + child: Text('选择播放顺序', style: titleStyle), ), ), + for (final PlayRepeat i in PlayRepeat.values) ...[ + ListTile( + dense: true, + onTap: () { + widget.controller.setPlayRepeat(i); + Get.back(); + }, + contentPadding: const EdgeInsets.only(left: 20, right: 20), + title: Text(i.description), + trailing: widget.controller.playRepeat == i + ? Icon( + Icons.done, + color: theme.colorScheme.primary, + ) + : const SizedBox.shrink(), + ) + ], ], ), ), diff --git a/lib/pages/whisper_detail/view.dart b/lib/pages/whisper_detail/view.dart index 407fbdac..2d509d50 100644 --- a/lib/pages/whisper_detail/view.dart +++ b/lib/pages/whisper_detail/view.dart @@ -70,12 +70,7 @@ class _WhisperDetailPageState onTap: () { if (_whisperDetailController.mid != null) { feedBack(); - Get.toNamed( - '/member?mid=${_whisperDetailController.mid}', - arguments: { - 'face': _whisperDetailController.face, - }, - ); + Get.toNamed('/member?mid=${_whisperDetailController.mid}'); } }, child: Row( diff --git a/lib/pages/whisper_detail/widget/chat_item.dart b/lib/pages/whisper_detail/widget/chat_item.dart index 4f189203..e2de43d2 100644 --- a/lib/pages/whisper_detail/widget/chat_item.dart +++ b/lib/pages/whisper_detail/widget/chat_item.dart @@ -559,15 +559,15 @@ class ChatItem extends StatelessWidget { } Widget msgTypePic_2(BuildContext context, content) { + final url = content['url']; return GestureDetector( - onTap: () => - context.imageView(imgList: [SourceModel(url: content['url'])]), + onTap: () => context.imageView(imgList: [SourceModel(url: url)]), child: Hero( - tag: content['url'], + tag: url, child: NetworkImgLayer( width: 220, height: 220 * content['height'] / content['width'], - src: content['url'], + src: url, ), ), ); @@ -610,12 +610,13 @@ class ChatItem extends StatelessWidget { RegExp(r"\[[^\[\]]+\]"), onMatch: (Match match) { final String emojiKey = match[0]!; + final size = emojiMap[emojiKey]!['size']; if (emojiMap.containsKey(emojiKey)) { children.add( WidgetSpan( child: NetworkImgLayer( - width: emojiMap[emojiKey]!['size'], - height: emojiMap[emojiKey]!['size'], + width: size, + height: size, src: emojiMap[emojiKey]!['url'], type: ImageType.emote, ), @@ -718,15 +719,14 @@ class ChatItem extends StatelessWidget { } Widget msgTypePictureCard_13(dynamic content) { + final url = content['jump_url']; return Center( child: ConstrainedBox( constraints: const BoxConstraints(maxWidth: 400.0), child: ClipRRect( borderRadius: StyleString.mdRadius, child: GestureDetector( - onTap: content['jump_url'] == null - ? null - : () => PiliScheme.routePushFromUrl(content['jump_url']), + onTap: url == null ? null : () => PiliScheme.routePushFromUrl(url), child: CachedNetworkImage( imageUrl: Utils.thumbnailImgUrl(content['pic_url']), ), diff --git a/lib/plugin/pl_player/widgets/backward_seek.dart b/lib/plugin/pl_player/widgets/backward_seek.dart index 6e0983c6..dcbb02fb 100644 --- a/lib/plugin/pl_player/widgets/backward_seek.dart +++ b/lib/plugin/pl_player/widgets/backward_seek.dart @@ -48,40 +48,43 @@ class BackwardSeekIndicatorState extends State { @override Widget build(BuildContext context) { - return InkWell( - splashColor: const Color(0x44767676), - onTap: increment, - child: Container( - decoration: const BoxDecoration( - gradient: LinearGradient( - colors: [ - Color(0x88767676), - Color(0x00767676), - ], - begin: Alignment.centerLeft, - end: Alignment.centerRight, - ), - ), - alignment: Alignment.center, - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - const Icon( - Icons.fast_rewind, - size: 24.0, - color: Colors.white, + return Material( + type: MaterialType.transparency, + child: InkWell( + splashColor: const Color(0x44767676), + onTap: increment, + child: Container( + decoration: const BoxDecoration( + gradient: LinearGradient( + colors: [ + Color(0x88767676), + Color(0x00767676), + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, ), - const SizedBox(height: 8.0), - Text( - '快退${duration.inSeconds}秒', - style: const TextStyle( - fontSize: 12.0, + ), + alignment: Alignment.center, + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + const Icon( + Icons.fast_rewind, + size: 24.0, color: Colors.white, ), - ), - ], + const SizedBox(height: 8.0), + Text( + '快退${duration.inSeconds}秒', + style: const TextStyle( + fontSize: 12.0, + color: Colors.white, + ), + ), + ], + ), ), ), ); diff --git a/lib/plugin/pl_player/widgets/forward_seek.dart b/lib/plugin/pl_player/widgets/forward_seek.dart index 10d54a8b..44c2f6d9 100644 --- a/lib/plugin/pl_player/widgets/forward_seek.dart +++ b/lib/plugin/pl_player/widgets/forward_seek.dart @@ -48,39 +48,42 @@ class ForwardSeekIndicatorState extends State { @override Widget build(BuildContext context) { - return InkWell( - splashColor: const Color(0x44767676), - onTap: increment, - child: Container( - decoration: const BoxDecoration( - gradient: LinearGradient( - colors: [ - Color(0x00767676), - Color(0x88767676), - ], - begin: Alignment.centerLeft, - end: Alignment.centerRight, - ), - ), - alignment: Alignment.center, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - const Icon( - Icons.fast_forward, - size: 24.0, - color: Colors.white, + return Material( + type: MaterialType.transparency, + child: InkWell( + splashColor: const Color(0x44767676), + onTap: increment, + child: Container( + decoration: const BoxDecoration( + gradient: LinearGradient( + colors: [ + Color(0x00767676), + Color(0x88767676), + ], + begin: Alignment.centerLeft, + end: Alignment.centerRight, ), - const SizedBox(height: 8.0), - Text( - '快进${duration.inSeconds}秒', - style: const TextStyle( - fontSize: 12.0, + ), + alignment: Alignment.center, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + const Icon( + Icons.fast_forward, + size: 24.0, color: Colors.white, ), - ), - ], + const SizedBox(height: 8.0), + Text( + '快进${duration.inSeconds}秒', + style: const TextStyle( + fontSize: 12.0, + color: Colors.white, + ), + ), + ], + ), ), ), ); diff --git a/lib/utils/page_utils.dart b/lib/utils/page_utils.dart index 791af32e..76117720 100644 --- a/lib/utils/page_utils.dart +++ b/lib/utils/page_utils.dart @@ -138,21 +138,15 @@ class PageUtils { final ThemeData theme = Theme.of(context); return Theme( data: theme, - child: Material( - color: Colors.transparent, - child: Container( + child: Padding( + padding: const EdgeInsets.all(12), + child: Material( clipBehavior: Clip.hardEdge, - decoration: BoxDecoration( - color: theme.colorScheme.surface, - borderRadius: const BorderRadius.all(Radius.circular(12)), - ), - margin: const EdgeInsets.all(12), - padding: const EdgeInsets.only(left: 14, right: 14), + color: theme.colorScheme.surface, + borderRadius: const BorderRadius.all(Radius.circular(12)), child: ListView( - padding: - const EdgeInsets.symmetric(vertical: 0, horizontal: 20), + padding: const EdgeInsets.symmetric(vertical: 14), children: [ - const SizedBox(height: 10), const Center(child: Text('定时关闭', style: titleStyle)), const SizedBox(height: 10), ...[ @@ -167,30 +161,25 @@ class PageUtils { (choice) => ListTile( dense: true, onTap: () => onTap(choice), - contentPadding: EdgeInsets.zero, - title: Text(choice == -1 - ? '自定义' - : choice == 0 - ? "禁用" - : "$choice分钟后"), + title: Text( + choice == -1 + ? '自定义' + : choice == 0 + ? "禁用" + : "$choice分钟后", + style: titleStyle, + ), trailing: shutdownTimerService.scheduledExitInMinutes == choice ? Icon( + size: 20, Icons.done, color: theme.colorScheme.primary, ) : null, ), ), - const SizedBox(height: 6), - const Center( - child: SizedBox( - width: 125, - child: Divider(height: 1), - ), - ), if (!isLive) ...[ - const SizedBox(height: 10), ListTile( dense: true, onTap: () { @@ -198,7 +187,6 @@ class PageUtils { !shutdownTimerService.waitForPlayingCompleted; setState(() {}); }, - contentPadding: EdgeInsets.zero, title: const Text("额外等待视频播放完毕", style: titleStyle), trailing: Transform.scale( alignment: Alignment.centerRight, @@ -222,9 +210,9 @@ class PageUtils { ], const SizedBox(height: 10), Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ const Text('倒计时结束:', style: titleStyle), - const Spacer(), ActionRowLineItem( onTap: () { shutdownTimerService.exitApp = false; @@ -233,7 +221,6 @@ class PageUtils { text: " 暂停视频 ", selectStatus: !shutdownTimerService.exitApp, ), - const Spacer(), ActionRowLineItem( onTap: () { shutdownTimerService.exitApp = true; @@ -244,7 +231,6 @@ class PageUtils { ) ], ), - const SizedBox(height: 10), ], ), ), diff --git a/lib/utils/theme_utils.dart b/lib/utils/theme_utils.dart index 4ec7ae59..b1c8b08f 100644 --- a/lib/utils/theme_utils.dart +++ b/lib/utils/theme_utils.dart @@ -67,6 +67,7 @@ class ThemeUtils { ), cardTheme: CardThemeData( elevation: 1, + margin: EdgeInsets.zero, surfaceTintColor: isDynamic ? colorScheme.onSurfaceVariant : isDark