getManagedTimer method

  1. @mustCallSuper
  2. @override
Timer getManagedTimer (Duration duration, void callback())
@mustCallSuper, override

Creates a Timer instance that will be cancelled if active upon disposal.

Implementation

@mustCallSuper
@override
Timer getManagedTimer(Duration duration, void callback()) {
  _throwOnInvalidCall2(
      'getManagedTimer', 'duration', 'callback', duration, callback);
  var timer = new _ObservableTimer(duration, callback);
  _addObservableTimerDisposable(timer);
  return timer;
}