Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class _MyHomePageState extends State<MyHomePage> {
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)),
),
Expand Down
6 changes: 5 additions & 1 deletion lib/rounded_loading_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -128,7 +132,6 @@ class RoundedLoadingButtonState extends State<RoundedLoadingButton>
late Animation _squeezeAnimation;
late Animation _bounceAnimation;
late Animation _borderAnimation;

final _state = BehaviorSubject<ButtonState>.seeded(ButtonState.idle);

@override
Expand Down Expand Up @@ -196,6 +199,7 @@ class RoundedLoadingButtonState extends State<RoundedLoadingButton>
style: ElevatedButton.styleFrom(
surfaceTintColor: widget.disabledColor,
minimumSize: Size(_squeezeAnimation.value, widget.height),
side: widget.borderSide,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(widget.borderRadius),
),
Expand Down