diff --git a/example/lib/main.dart b/example/lib/main.dart index 8198001..3074da8 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -74,6 +74,7 @@ class _MyHomePageState extends State { onPressed: () => _doSomething(_btnController2), valueColor: Colors.black, borderRadius: 10, + borderSide : BorderSide(color: Colors.red) child: Text(''' Tap me i have a huge text''', style: TextStyle(color: Colors.white)), ), diff --git a/lib/rounded_loading_button.dart b/lib/rounded_loading_button.dart index fcb56ab..133a5d8 100644 --- a/lib/rounded_loading_button.dart +++ b/lib/rounded_loading_button.dart @@ -52,6 +52,9 @@ class RoundedLoadingButton extends StatefulWidget { /// The radius of the button border final double borderRadius; + /// The side of the button border + final BorderSide borderSide; + /// The duration of the button animation final Duration duration; @@ -100,6 +103,7 @@ class RoundedLoadingButton extends StatefulWidget { this.animateOnTap = true, this.valueColor = Colors.white, this.borderRadius = 35, + this.borderSide = BorderSide.none, this.elevation = 2, this.duration = const Duration(milliseconds: 500), this.curve = Curves.easeInOutCirc, @@ -128,7 +132,6 @@ class RoundedLoadingButtonState extends State late Animation _squeezeAnimation; late Animation _bounceAnimation; late Animation _borderAnimation; - final _state = BehaviorSubject.seeded(ButtonState.idle); @override @@ -196,6 +199,7 @@ class RoundedLoadingButtonState extends State style: ElevatedButton.styleFrom( surfaceTintColor: widget.disabledColor, minimumSize: Size(_squeezeAnimation.value, widget.height), + side: widget.borderSide, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(widget.borderRadius), ),