diff --git a/packages/flutter/lib/src/widgets/implicit_animations.dart b/packages/flutter/lib/src/widgets/implicit_animations.dart index 742727010a..a77557b259 100644 --- a/packages/flutter/lib/src/widgets/implicit_animations.dart +++ b/packages/flutter/lib/src/widgets/implicit_animations.dart @@ -360,7 +360,7 @@ abstract class ImplicitlyAnimatedWidgetState /// The animation driving this widget's implicit animations. Animation get animation => _animation; - late Animation _animation = _createCurve(); + late CurvedAnimation _animation = _createCurve(); @override void initState() { @@ -383,7 +383,7 @@ abstract class ImplicitlyAnimatedWidgetState void didUpdateWidget(T oldWidget) { super.didUpdateWidget(oldWidget); if (widget.curve != oldWidget.curve) { - (_animation as CurvedAnimation).dispose(); + _animation.dispose(); _animation = _createCurve(); } _controller.duration = widget.duration; @@ -405,7 +405,7 @@ abstract class ImplicitlyAnimatedWidgetState @override void dispose() { - (_animation as CurvedAnimation).dispose(); + _animation.dispose(); _controller.dispose(); super.dispose(); }