From c9b66c4256be446c4b88306e43697b737519950e Mon Sep 17 00:00:00 2001 From: Zixuan James Li Date: Tue, 3 Dec 2024 21:59:23 -0500 Subject: [PATCH] action_sheet: Put a height constraint on cancel button With a small font size, the button can be shorter than the Figma design. See: https://www.figma.com/design/1JTNtYo9memgW7vV6d0ygq/Zulip-Mobile?node-id=3479-26262&node-type=symbol&t=hGZtzX2QTLse81un-0 Signed-off-by: Zixuan James Li --- lib/widgets/action_sheet.dart | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/lib/widgets/action_sheet.dart b/lib/widgets/action_sheet.dart index 3a786874b6d..1e07ed58d68 100644 --- a/lib/widgets/action_sheet.dart +++ b/lib/widgets/action_sheet.dart @@ -167,23 +167,24 @@ class ActionSheetCancelButton extends StatelessWidget { @override Widget build(BuildContext context) { final designVariables = DesignVariables.of(context); - return TextButton( - style: TextButton.styleFrom( - padding: const EdgeInsets.all(10), - foregroundColor: designVariables.contextMenuCancelText, - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(7)), - splashFactory: NoSplash.splashFactory, - ).copyWith(backgroundColor: WidgetStateColor.fromMap({ - WidgetState.pressed: designVariables.contextMenuCancelPressedBg, - ~WidgetState.pressed: designVariables.contextMenuCancelBg, - })), - onPressed: () { - Navigator.pop(context); - }, - child: Text(ZulipLocalizations.of(context).dialogCancel, - style: const TextStyle(fontSize: 20, height: 24 / 20) - .merge(weightVariableTextStyle(context, wght: 600))), - ); + return ConstrainedBox( + constraints: const BoxConstraints(minHeight: 44), + child: TextButton( + style: TextButton.styleFrom( + padding: const EdgeInsets.all(10), + foregroundColor: designVariables.contextMenuCancelText, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(7)), + splashFactory: NoSplash.splashFactory, + ).copyWith(backgroundColor: WidgetStateColor.fromMap({ + WidgetState.pressed: designVariables.contextMenuCancelPressedBg, + ~WidgetState.pressed: designVariables.contextMenuCancelBg, + })), + onPressed: () { + Navigator.pop(context); + }, + child: Text(ZulipLocalizations.of(context).dialogCancel, + style: const TextStyle(fontSize: 20, height: 24 / 20) + .merge(weightVariableTextStyle(context, wght: 600))))); } }