getManagedPeriodicTimer method

  1. @mustCallSuper
  2. @override
Timer getManagedPeriodicTimer(
  1. Duration duration,
  2. void callback(
    1. Timer timer
    )
)
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 = _ObservableTimer.periodic(duration, callback);
  _addObservableTimerDisposable(timer);
  return timer;
}