startAutoClearTimer method

void startAutoClearTimer({
  1. required Duration timeout,
  2. required VoidCallback onTimeout,
})

Starts an auto-clear timer that will call onTimeout after timeout duration of inactivity.

The timer resets whenever resetTimer is called (typically when user interacts with the PIN input).

Implementation

void startAutoClearTimer({
  required Duration timeout,
  required VoidCallback onTimeout,
}) {
  _autoClearTimer?.cancel();
  _autoClearTimer = Timer(timeout, onTimeout);
}