onButtonChange method
Implementation
void onButtonChange(int slideNo, bool flag) {
if (flag) {
_step = slideNo;
_onStepController.add(step);
timer?.cancel();
if (duration != null) {
timer = Timer(Duration(milliseconds: duration!), () => stepBy(1));
}
_changeDetectorRef.markForCheck();
}
}