@@ -23,8 +23,6 @@ export 'package:flutter/scheduler.dart' show TickerFuture, TickerProvider;
23
23
export 'animation.dart' show Animation, AnimationStatus;
24
24
export 'curves.dart' show Curve;
25
25
26
- const String _flutterAnimationLibrary = 'package:flutter/animation.dart' ;
27
-
28
26
// Examples can assume:
29
27
// late AnimationController _controller, fadeAnimationController, sizeAnimationController;
30
28
// late bool dismissed;
@@ -255,9 +253,7 @@ class AnimationController extends Animation<double>
255
253
required TickerProvider vsync,
256
254
}) : assert (upperBound >= lowerBound),
257
255
_direction = _AnimationDirection .forward {
258
- if (kFlutterMemoryAllocationsEnabled) {
259
- _maybeDispatchObjectCreation ();
260
- }
256
+ assert (debugMaybeDispatchCreated ('animation' , 'AnimationController' , this ));
261
257
_ticker = vsync.createTicker (_tick);
262
258
_internalSetValue (value ?? lowerBound);
263
259
}
@@ -289,24 +285,11 @@ class AnimationController extends Animation<double>
289
285
}) : lowerBound = double .negativeInfinity,
290
286
upperBound = double .infinity,
291
287
_direction = _AnimationDirection .forward {
292
- if (kFlutterMemoryAllocationsEnabled) {
293
- _maybeDispatchObjectCreation ();
294
- }
288
+ assert (debugMaybeDispatchCreated ('animation' , 'AnimationController' , this ));
295
289
_ticker = vsync.createTicker (_tick);
296
290
_internalSetValue (value);
297
291
}
298
292
299
- /// Dispatches event of object creation to [FlutterMemoryAllocations.instance] .
300
- void _maybeDispatchObjectCreation () {
301
- if (kFlutterMemoryAllocationsEnabled) {
302
- FlutterMemoryAllocations .instance.dispatchObjectCreated (
303
- library: _flutterAnimationLibrary,
304
- className: '$AnimationController ' ,
305
- object: this ,
306
- );
307
- }
308
- }
309
-
310
293
/// The value at which this animation is deemed to be dismissed.
311
294
final double lowerBound;
312
295
@@ -946,9 +929,7 @@ class AnimationController extends Animation<double>
946
929
}
947
930
return true ;
948
931
}());
949
- if (kFlutterMemoryAllocationsEnabled) {
950
- FlutterMemoryAllocations .instance.dispatchObjectDisposed (object: this );
951
- }
932
+ assert (debugMaybeDispatchDisposed (this ));
952
933
_ticker! .dispose ();
953
934
_ticker = null ;
954
935
clearStatusListeners ();
0 commit comments