diff --git a/lib/pages/bangumi/introduction/view.dart b/lib/pages/bangumi/introduction/view.dart index 660d8d155..dd79149cd 100644 --- a/lib/pages/bangumi/introduction/view.dart +++ b/lib/pages/bangumi/introduction/view.dart @@ -395,12 +395,8 @@ class _BangumiInfoState extends State { padding: const EdgeInsets.only(top: 1), child: SizedBox( height: 48, - child: GridView.count( - physics: const NeverScrollableScrollPhysics(), - primary: false, - padding: EdgeInsets.zero, - crossAxisCount: 5, - childAspectRatio: 1.25, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ Obx(() => ActionItem( icon: const Icon(FontAwesomeIcons.thumbsUp), diff --git a/lib/pages/video/detail/introduction/view.dart b/lib/pages/video/detail/introduction/view.dart index 2bd309aa7..f23a8f463 100644 --- a/lib/pages/video/detail/introduction/view.dart +++ b/lib/pages/video/detail/introduction/view.dart @@ -493,12 +493,8 @@ class _VideoInfoState extends State with TickerProviderStateMixin { return Container( margin: const EdgeInsets.only(top: 1), height: 48, - child: GridView.count( - physics: const NeverScrollableScrollPhysics(), - primary: false, - padding: EdgeInsets.zero, - crossAxisCount: 5, - childAspectRatio: 1.25, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ Obx( () => ActionItem( diff --git a/lib/pages/video/detail/introduction/widgets/action_item.dart b/lib/pages/video/detail/introduction/widgets/action_item.dart index 752923ad9..b68324b79 100644 --- a/lib/pages/video/detail/introduction/widgets/action_item.dart +++ b/lib/pages/video/detail/introduction/widgets/action_item.dart @@ -26,54 +26,56 @@ class ActionItem extends StatelessWidget { @override Widget build(BuildContext context) { - return Semantics( - label: (text ?? "") + (selectStatus ? "已" :"") + semanticsLabel, - child: - InkWell( - onTap: () => { - feedBack(), - onTap!(), - }, - onLongPress: () => { - if (onLongPress != null) {onLongPress!()} - }, - borderRadius: StyleString.mdRadius, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - // const SizedBox(height: 2), - Icon( - selectStatus - ? selectIcon!.icon! - : icon!.icon!, - size: 18, - color: selectStatus - ? Theme.of(context).colorScheme.primary - : Theme.of(context).colorScheme.outline, - ), - const SizedBox(height: 3), - AnimatedOpacity( - opacity: loadingStatus! ? 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); + return Expanded( + child: Semantics( + label: (text ?? "") + (selectStatus ? "已" : "") + semanticsLabel, + child: InkWell( + onTap: () => { + feedBack(), + onTap!(), }, - child: Text( - text ?? '', - key: ValueKey(text ?? ''), - style: TextStyle( + onLongPress: () => { + if (onLongPress != null) {onLongPress!()} + }, + // borderRadius: StyleString.mdRadius, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + // const SizedBox(height: 2), + Icon( + selectStatus ? selectIcon!.icon! : icon!.icon!, + size: 18, color: selectStatus ? Theme.of(context).colorScheme.primary : Theme.of(context).colorScheme.outline, - fontSize: Theme.of(context).textTheme.labelSmall!.fontSize), - semanticsLabel: "", + ), + const SizedBox(height: 3), + AnimatedOpacity( + opacity: loadingStatus! ? 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.of(context).colorScheme.primary + : Theme.of(context).colorScheme.outline, + fontSize: Theme.of(context) + .textTheme + .labelSmall! + .fontSize), + semanticsLabel: "", + ), + ), + ), + ], ), - ), - ), - ], - ), - )); + ))); } }