messageTimerChanged static method

dynamic messageTimerChanged({
  1. required int time,
})

Restarts the timer with a new time. @param time The time interval in seconds.

Implementation

static messageTimerChanged({required int time}) {
  if (timer != null) {
    timer?.cancel();
    timer = null;
  }
  timer = Timer.periodic(
    Duration(seconds: time),
    (timer) => checkMessages(fromStartup: false),
  );
}