complete method
Completes the slider
Implementation
void complete() {
final trackWidth = context.size!.width;
_controller.animateTo(
widget.handleWidth / trackWidth,
duration: const Duration(milliseconds: 200),
curve: Curves.fastOutSlowIn,
);
if (!widget.animate) {
_controller.animateTo(
trackWidth,
duration: const Duration(milliseconds: 800),
curve: Curves.fastOutSlowIn,
);
} else {
_isComplete = widget.stayCompleted;
widget.onSlide();
}
}