From 7c185c877a619f2d29c68419178cc0462639bdc4 Mon Sep 17 00:00:00 2001 From: Daniel Eshkeri Date: Fri, 4 Oct 2024 14:40:42 +0100 Subject: [PATCH] fix: added space between button and label fix: constrained the width of the label to 100 so it wraps if it's too long. Let me know if you have a better solution that mine --- lib/src/components/fabs/fab.dart | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/lib/src/components/fabs/fab.dart b/lib/src/components/fabs/fab.dart index 032d3bab..c1364a6b 100644 --- a/lib/src/components/fabs/fab.dart +++ b/lib/src/components/fabs/fab.dart @@ -162,14 +162,29 @@ class _ZetaFABState extends State { if (widget.expanded && widget.label != null) Row( mainAxisSize: MainAxisSize.min, - children: [Text(widget.label!, style: ZetaTextStyles.labelLarge)], + children: [ + Text( + widget.label!, + style: ZetaTextStyles.labelLarge, + ), + ], ), ].divide(SizedBox(width: Zeta.of(context).spacing.small)).toList(), ), ), ), ), - if (!widget.expanded && widget.label != null) Text(widget.label!, style: ZetaTextStyles.bodyMedium), + if (!widget.expanded && widget.label != null) + Container( + margin: EdgeInsets.only(top: Zeta.of(context).spacing.minimum), + width: 100, // TODO DE: Is there a better way to do this? + alignment: Alignment.center, + child: Text( + widget.label!, + style: ZetaTextStyles.bodyMedium, + textAlign: TextAlign.center, + ), + ), ], ); }