From 343b51a781bc5ae0dcc0c43e9cb5bd0552d185db Mon Sep 17 00:00:00 2001 From: "Michael W. Aziz" Date: Sun, 19 May 2024 10:18:19 +0300 Subject: [PATCH] [DEV] Done with the buttons --- lib/src/Buttons/src/state_button.dart | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/lib/src/Buttons/src/state_button.dart b/lib/src/Buttons/src/state_button.dart index 8aecdd6..0c77f8d 100644 --- a/lib/src/Buttons/src/state_button.dart +++ b/lib/src/Buttons/src/state_button.dart @@ -58,7 +58,7 @@ class AstromicStateButton extends StatefulWidget { //s1 -- Content this.loadingContent, required this.content, - }); + }) : assert(heightSizingStrategy != SizingStrategy.fill, 'Height strategy cannot be fill'); @override State createState() => _AstromicStateButtonState(); @@ -160,15 +160,22 @@ class _AstromicStateButtonState extends State { //!SECTION //SECTION - Build Return - return SizedBox( - width: widget.widthSizingStrategy == SizingStrategy.fixed && widget.style != null ? widget.style!(widget.isEnabled, isHighlighted, isLoading).fixedWidth : null, - height: widget.heightSizingStrategy == SizingStrategy.fixed && widget.style != null ? widget.style!(widget.isEnabled, isHighlighted, isLoading).fixedHeight : null, - child: Row( - mainAxisSize: widget.widthSizingStrategy == SizingStrategy.hug ? MainAxisSize.min : MainAxisSize.max, - children: [ - baseChild, - ], - ), + return Row( + mainAxisSize: widget.widthSizingStrategy == SizingStrategy.hug ? MainAxisSize.min : MainAxisSize.max, + children: [ + widget.widthSizingStrategy == SizingStrategy.fill + ? Expanded( + child: SizedBox( + height: widget.heightSizingStrategy == SizingStrategy.fixed && widget.style != null ? widget.style!(widget.isEnabled, isHighlighted, isLoading).fixedHeight : null, + child: baseChild, + ), + ) + : SizedBox( + width: widget.widthSizingStrategy == SizingStrategy.fixed && widget.style != null ? widget.style!(widget.isEnabled, isHighlighted, isLoading).fixedWidth : null, + height: widget.heightSizingStrategy == SizingStrategy.fixed && widget.style != null ? widget.style!(widget.isEnabled, isHighlighted, isLoading).fixedHeight : null, + child: baseChild, + ), + ], ); //!SECTION }