showOrHide method

void showOrHide({
  1. bool? visible,
  2. bool startTimer = true,
})

Change the state of the controller so that it can be shown or hidden.

Implementation

void showOrHide({bool? visible, bool startTimer = true}) {
  if (startTimer) {
    resetSeconds();
  } else {
    _currentSeconds = hideSeconds + 1;
  }

  setVisible(visible ?? !value.isVisible);
}