From da387bd9ce05971334cabdfd72c5d3058e08ff21 Mon Sep 17 00:00:00 2001 From: Edouard Marquez Date: Fri, 4 Aug 2023 15:43:16 +0200 Subject: [PATCH] Smooth Dialog: when there is just on button, ensure we have equal padding --- .../lib/generic_lib/dialogs/smooth_alert_dialog.dart | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/smooth_app/lib/generic_lib/dialogs/smooth_alert_dialog.dart b/packages/smooth_app/lib/generic_lib/dialogs/smooth_alert_dialog.dart index e6d4187de3d..55a85f33982 100644 --- a/packages/smooth_app/lib/generic_lib/dialogs/smooth_alert_dialog.dart +++ b/packages/smooth_app/lib/generic_lib/dialogs/smooth_alert_dialog.dart @@ -103,10 +103,16 @@ class SmoothAlertDialog extends StatelessWidget { } Padding _buildBottomBar(EdgeInsetsDirectional padding) { + final bool singleButton = + positiveAction != null && negativeAction == null || + negativeAction != null && positiveAction == null; + return Padding( padding: EdgeInsetsDirectional.only( top: padding.bottom, - start: actionsAxis == Axis.horizontal ? SMALL_SPACE : 0.0, + start: (actionsAxis == Axis.horizontal || singleButton) + ? SMALL_SPACE + : 0.0, end: positiveAction != null && negativeAction != null ? 0.0 : SMALL_SPACE,