onButtonChange method

void onButtonChange(
  1. int slideNo,
  2. bool flag
)

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();
  }
}