diff --git a/lib/src/Buttons/buttons.astromic.dart b/lib/src/Buttons/buttons.astromic.dart index 93462e2..fd55694 100644 --- a/lib/src/Buttons/buttons.astromic.dart +++ b/lib/src/Buttons/buttons.astromic.dart @@ -34,9 +34,9 @@ class AstromicButtons { onTap: onTap, onHold: onHold, // - isEnabled: isEnabled, - withFeedback: withFeedback, - withHighlightChange: withHighlightChange, + isEnabled: isEnabled ?? true, + withFeedback: withFeedback ?? true, + withHighlightChange: withHighlightChange ?? true, // widthSizingStrategy: widthSizingStrategy, heightSizingStrategy: heightSizingStrategy, @@ -92,7 +92,7 @@ class AstromicButtons { // bool? isUnderlined, EdgeInsetsGeometry? contentPadding, - required TextStyle Function(bool isEnabled)? style, + TextStyle Function(bool isEnabled)? style, // String? text, Widget? textWidget, @@ -103,10 +103,10 @@ class AstromicButtons { onTap: onTap, onHold: onHold, // - isEnabled: isEnabled, - textDirection: textDirection, + isEnabled: isEnabled ?? true, + textDirection: textDirection ?? TextDirection.ltr, // - isUnderlined: isUnderlined, + isUnderlined: isUnderlined ?? true, contentPadding: contentPadding, style: style, // diff --git a/lib/src/Buttons/src/link_button.dart b/lib/src/Buttons/src/link_button.dart index 4ce26b0..f63bd0d 100644 --- a/lib/src/Buttons/src/link_button.dart +++ b/lib/src/Buttons/src/link_button.dart @@ -25,10 +25,10 @@ class AstromicLinkButton extends StatelessWidget { final VoidCallback? onTap; final VoidCallback? onHold; //s1 -- Configurations - final bool? isEnabled; - final TextDirection? textDirection; + final bool isEnabled; + final TextDirection textDirection; //s1 -- Style - final bool? isUnderlined; + final bool isUnderlined; final EdgeInsetsGeometry? contentPadding; final TextStyle Function(bool isEnabled)? style; // @@ -45,10 +45,10 @@ class AstromicLinkButton extends StatelessWidget { this.onTap, this.onHold, //s1 -- Configurations - this.isEnabled = true, - this.textDirection, + required this.isEnabled, + required this.textDirection, //s1 -- Style - this.isUnderlined = true, + required this.isUnderlined, this.contentPadding, this.style, //s1 -- Content @@ -82,7 +82,7 @@ class AstromicLinkButton extends StatelessWidget { onTap: onTap, onHold: onHold, // - isEnabled: isEnabled!, + isEnabled: isEnabled, withFeedback: false, withHighlightChange: false, isFullWidth: false, @@ -102,10 +102,10 @@ class AstromicLinkButton extends StatelessWidget { text!, style: style != null ? style!(isEnabled).copyWith( - decoration: isUnderlined! ? TextDecoration.underline : TextDecoration.none, + decoration: isUnderlined ? TextDecoration.underline : TextDecoration.none, ) : TextStyle( - decoration: isUnderlined! ? TextDecoration.underline : TextDecoration.none, + decoration: isUnderlined ? TextDecoration.underline : TextDecoration.none, ), ), if (suffix != null) suffix!, diff --git a/lib/src/Buttons/src/state_button.dart b/lib/src/Buttons/src/state_button.dart index b312568..b08e591 100644 --- a/lib/src/Buttons/src/state_button.dart +++ b/lib/src/Buttons/src/state_button.dart @@ -26,9 +26,9 @@ class AstromicStateButton extends StatefulWidget { final void Function(VoidCallback start, VoidCallback stop)? onTap; final Function(VoidCallback start, VoidCallback stop)? onHold; //s1 -- Configurations - final bool? isEnabled; - final bool? withFeedback; - final bool? withHighlightChange; + final bool isEnabled; + final bool withFeedback; + final bool withHighlightChange; //s1 -- Style final SizingStrategy? widthSizingStrategy; final SizingStrategy? heightSizingStrategy; @@ -45,9 +45,9 @@ class AstromicStateButton extends StatefulWidget { this.onTap, this.onHold, // - this.isEnabled = true, - this.withFeedback = true, - this.withHighlightChange = true, + required this.isEnabled, + required this.withFeedback, + required this.withHighlightChange, //s1 -- Style this.widthSizingStrategy = SizingStrategy.hug, this.heightSizingStrategy = SizingStrategy.hug, @@ -104,9 +104,9 @@ class _AstromicStateButtonState extends State { //s1 -Widgets //----- Widget baseChild = AstromicButtonBase( - isEnabled: widget.isEnabled!, - withFeedback: widget.withFeedback!, - withHighlightChange: widget.withHighlightChange!, + isEnabled: widget.isEnabled, + withFeedback: widget.withFeedback, + withHighlightChange: widget.withHighlightChange, isFullWidth: false, // onTap: !isLoading && context.mounted && widget.onTap != null @@ -159,8 +159,8 @@ class _AstromicStateButtonState extends State { //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, + 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: [