@@ -281,7 +281,6 @@ public TickerFuture repeat(float? min = null, float? max = null, bool reverse =
281
281
282
282
D . assert ( max >= min ) ;
283
283
D . assert ( max <= this . upperBound && min >= this . lowerBound ) ;
284
- D . assert ( reverse != null ) ;
285
284
return this . animateWith ( new _RepeatingSimulation ( this . _value , min . Value , max . Value , reverse , period . Value ) ) ;
286
285
}
287
286
@@ -298,6 +297,11 @@ public TickerFuture fling(float velocity = 1.0f) {
298
297
299
298
300
299
public TickerFuture animateWith ( Simulation simulation ) {
300
+ D . assert (
301
+ this . _ticker != null ,
302
+ "AnimationController.animateWith() called after AnimationController.dispose()\n " +
303
+ "AnimationController methods should not be used after calling dispose."
304
+ ) ;
301
305
this . stop ( ) ;
302
306
return this . _startSimulation ( simulation ) ;
303
307
}
@@ -317,6 +321,11 @@ TickerFuture _startSimulation(Simulation simulation) {
317
321
}
318
322
319
323
public void stop ( bool canceled = true ) {
324
+ D . assert (
325
+ this . _ticker != null ,
326
+ "AnimationController.stop() called after AnimationController.dispose()\n " +
327
+ "AnimationController methods should not be used after calling dispose."
328
+ ) ;
320
329
this . _simulation = null ;
321
330
this . _lastElapsedDuration = null ;
322
331
this . _ticker . stop ( canceled : canceled ) ;
@@ -430,6 +439,7 @@ internal _RepeatingSimulation(float initialValue, float min, float max, bool rev
430
439
this . _max = max ;
431
440
this . _periodInSeconds = ( float ) period . Ticks / TimeSpan . TicksPerSecond ;
432
441
this . _initialT = ( max == min ) ? 0.0f : ( initialValue / ( max - min ) ) * ( period . Ticks / TimeSpan . TicksPerSecond ) ;
442
+ this . _reverse = reverse ;
433
443
D . assert ( this . _periodInSeconds > 0.0f ) ;
434
444
D . assert ( this . _initialT >= 0.0f ) ;
435
445
}
0 commit comments