getManagedPeriodicTimer method

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

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

Implementation

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