From 8c26ef4ff60df82d72c8dcee9854af411e1b900e Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Fri, 18 Oct 2024 22:57:39 +0800 Subject: [PATCH] mod: minimize reply item btn --- .../video/detail/reply/widgets/reply_item_grpc.dart | 9 +++++++++ lib/pages/video/detail/reply/widgets/zan_grpc.dart | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/lib/pages/video/detail/reply/widgets/reply_item_grpc.dart b/lib/pages/video/detail/reply/widgets/reply_item_grpc.dart index 516ed7a9..376ff535 100644 --- a/lib/pages/video/detail/reply/widgets/reply_item_grpc.dart +++ b/lib/pages/video/detail/reply/widgets/reply_item_grpc.dart @@ -334,6 +334,12 @@ class ReplyItemGrpc extends StatelessWidget { ); } + get _style => TextButton.styleFrom( + padding: const EdgeInsets.all(0), + tapTargetSize: MaterialTapTargetSize.shrinkWrap, + visualDensity: VisualDensity(horizontal: -2, vertical: -2), + ); + // 感谢、回复、复制 Widget buttonAction(BuildContext context, replyControl) { return Row( @@ -342,6 +348,7 @@ class ReplyItemGrpc extends StatelessWidget { SizedBox( height: 32, child: TextButton( + style: _style, onPressed: () { feedBack(); if (onReply != null) { @@ -371,6 +378,7 @@ class ReplyItemGrpc extends StatelessWidget { height: 32, child: TextButton( onPressed: null, + style: _style, child: Text( 'UP主觉得很赞', style: TextStyle( @@ -400,6 +408,7 @@ class ReplyItemGrpc extends StatelessWidget { height: 32, child: TextButton( onPressed: showDialogue, + style: _style, child: Text( '查看对话', style: TextStyle( diff --git a/lib/pages/video/detail/reply/widgets/zan_grpc.dart b/lib/pages/video/detail/reply/widgets/zan_grpc.dart index 0153355d..95d6b516 100644 --- a/lib/pages/video/detail/reply/widgets/zan_grpc.dart +++ b/lib/pages/video/detail/reply/widgets/zan_grpc.dart @@ -101,6 +101,12 @@ class _ZanButtonGrpcState extends State { }; } + get _style => TextButton.styleFrom( + padding: const EdgeInsets.all(0), + tapTargetSize: MaterialTapTargetSize.shrinkWrap, + visualDensity: VisualDensity(horizontal: -2, vertical: -2), + ); + @override Widget build(BuildContext context) { final ThemeData t = Theme.of(context); @@ -112,6 +118,7 @@ class _ZanButtonGrpcState extends State { SizedBox( height: 32, child: TextButton( + style: _style, onPressed: handleState(onHateReply), child: Icon( widget.replyItem.replyControl.action.toInt() == 2 @@ -130,6 +137,7 @@ class _ZanButtonGrpcState extends State { SizedBox( height: 32, child: TextButton( + style: _style, onPressed: handleState(onLikeReply), child: Row( children: [