@@ -103,7 +103,7 @@ class FakeAsync {
103103 /// Note: it's usually more convenient to use [fakeAsync] rather than creating
104104 /// a [FakeAsync] object and calling [run] manually.
105105 FakeAsync ({DateTime ? initialTime, this .includeTimerStackTrace = true }) {
106- var nonNullInitialTime = initialTime ?? clock.now ();
106+ final nonNullInitialTime = initialTime ?? clock.now ();
107107 _clock = Clock (() => nonNullInitialTime.add (elapsed));
108108 }
109109
@@ -156,7 +156,7 @@ class FakeAsync {
156156 }
157157
158158 _elapsed += duration;
159- var elapsingTo = _elapsingTo;
159+ final elapsingTo = _elapsingTo;
160160 if (elapsingTo != null && _elapsed > elapsingTo) _elapsingTo = _elapsed;
161161 }
162162
@@ -169,7 +169,7 @@ class FakeAsync {
169169 /// The [`clock`][] property will be set to a clock that reports the fake
170170 /// elapsed time. By default, it starts at the time the [FakeAsync] was
171171 /// created (according to [`clock.now()`][] ), but this can be controlled by
172- /// passing `initialTime` to [new FakeAsync] .
172+ /// passing `initialTime` to [FakeAsync.new ] .
173173 ///
174174 /// [`clock`] : https://www.dartdocs.org/documentation/clock/latest/clock/clock.html
175175 /// [`clock.now()`] : https://www.dartdocs.org/documentation/clock/latest/clock/Clock/now.html
@@ -210,7 +210,7 @@ class FakeAsync {
210210 void flushTimers (
211211 {Duration timeout = const Duration (hours: 1 ),
212212 bool flushPeriodicTimers = true }) {
213- var absoluteTimeout = _elapsed + timeout;
213+ final absoluteTimeout = _elapsed + timeout;
214214 _fireTimersWhile ((timer) {
215215 if (timer._nextCall > absoluteTimeout) {
216216 // TODO(nweiz): Make this a [TimeoutException].
@@ -237,7 +237,7 @@ class FakeAsync {
237237 for (;;) {
238238 if (_timers.isEmpty) break ;
239239
240- var timer = minBy (_timers, (FakeTimer timer) => timer._nextCall)! ;
240+ final timer = minBy (_timers, (FakeTimer timer) => timer._nextCall)! ;
241241 if (! predicate (timer)) break ;
242242
243243 _elapseTo (timer._nextCall);
@@ -249,7 +249,7 @@ class FakeAsync {
249249 /// Creates a new timer controlled by `this` that fires [callback] after
250250 /// [duration] (or every [duration] if [periodic] is `true` ).
251251 Timer _createTimer (Duration duration, Function callback, bool periodic) {
252- var timer = FakeTimer ._(duration, callback, periodic, this ,
252+ final timer = FakeTimer ._(duration, callback, periodic, this ,
253253 includeStackTrace: includeTimerStackTrace);
254254 _timers.add (timer);
255255 return timer;
@@ -320,10 +320,12 @@ class FakeTimer implements Timer {
320320 assert (isActive);
321321 _tick++ ;
322322 if (isPeriodic) {
323+ // ignore: avoid_dynamic_calls
323324 _callback (this );
324325 _nextCall += duration;
325326 } else {
326327 cancel ();
328+ // ignore: avoid_dynamic_calls
327329 _callback ();
328330 }
329331 }
0 commit comments