getManagedTimer method

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