Skip to content

Commit

Permalink
Smooth Dialog: when there is just on button, ensure we have equal pad…
Browse files Browse the repository at this point in the history
…ding
  • Loading branch information
g123k committed Aug 4, 2023
1 parent 13e6d54 commit da387bd
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit da387bd

Please sign in to comment.