start method

Future<bool> start()

Starts the timer, if it is not already started.

Resolves to true if and when the callback is called. Otherwise, resolves to false when the timer is cancelled.

Implementation

Future<bool> start() {
  if (_timer == null) {
    _completer = Completer<bool>();
    _timer = Timer(_duration, _wrappedCallback);
  }
  return _completer!.future;
}