Skip to content

Commit

Permalink
Handle null animation or controller in _stopHandlerAnimation function
Browse files Browse the repository at this point in the history
  • Loading branch information
john-paradym committed Nov 23, 2023
1 parent 9411ebf commit da2744c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/another_xlider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1716,13 +1716,13 @@ class FlutterSliderState extends State<FlutterSlider> with TickerProviderStateMi

void _stopHandlerAnimation({Animation? animation, AnimationController? controller}) {
if (widget.handlerAnimation.reverseCurve != null) {
if (animation!.isCompleted) {
controller!.reverse();
if (animation?.isCompleted ?? false) {
controller?.reverse();
} else {
controller!.reset();
controller?.reset();
}
} else {
controller!.reset();
controller?.reset();
}
}

Expand Down

0 comments on commit da2744c

Please sign in to comment.