Ignore unnecessary casts that can go away soon. (#64200)

diff --git a/packages/flutter/lib/src/animation/animation_controller.dart b/packages/flutter/lib/src/animation/animation_controller.dart
index 2b1b081..deedfc9 100644
--- a/packages/flutter/lib/src/animation/animation_controller.dart
+++ b/packages/flutter/lib/src/animation/animation_controller.dart
@@ -397,7 +397,7 @@
   }
 
   void _internalSetValue(double newValue) {
-    _value = newValue.clamp(lowerBound, upperBound) as double;
+    _value = newValue.clamp(lowerBound, upperBound) as double; // ignore: unnecessary_cast
     if (_value == lowerBound) {
       _status = AnimationStatus.dismissed;
     } else if (_value == upperBound) {
@@ -581,7 +581,7 @@
     stop();
     if (simulationDuration == Duration.zero) {
       if (value != target) {
-        _value = target.clamp(lowerBound, upperBound) as double;
+        _value = target.clamp(lowerBound, upperBound) as double; // ignore: unnecessary_cast
         notifyListeners();
       }
       _status = (_direction == _AnimationDirection.forward) ?
@@ -710,7 +710,7 @@
     assert(!isAnimating);
     _simulation = simulation;
     _lastElapsedDuration = Duration.zero;
-    _value = simulation.x(0.0).clamp(lowerBound, upperBound) as double;
+    _value = simulation.x(0.0).clamp(lowerBound, upperBound) as double; // ignore: unnecessary_cast
     final TickerFuture result = _ticker!.start();
     _status = (_direction == _AnimationDirection.forward) ?
       AnimationStatus.forward :
@@ -787,7 +787,7 @@
     _lastElapsedDuration = elapsed;
     final double elapsedInSeconds = elapsed.inMicroseconds.toDouble() / Duration.microsecondsPerSecond;
     assert(elapsedInSeconds >= 0.0);
-    _value = _simulation!.x(elapsedInSeconds).clamp(lowerBound, upperBound) as double;
+    _value = _simulation!.x(elapsedInSeconds).clamp(lowerBound, upperBound) as double; // ignore: unnecessary_cast
     if (_simulation!.isDone(elapsedInSeconds)) {
       _status = (_direction == _AnimationDirection.forward) ?
         AnimationStatus.completed :
@@ -822,7 +822,7 @@
 
   @override
   double x(double timeInSeconds) {
-    final double t = (timeInSeconds / _durationInSeconds).clamp(0.0, 1.0) as double;
+    final double t = (timeInSeconds / _durationInSeconds).clamp(0.0, 1.0) as double; // ignore: unnecessary_cast
     if (t == 0.0)
       return _begin;
     else if (t == 1.0)
diff --git a/packages/flutter/lib/src/animation/curves.dart b/packages/flutter/lib/src/animation/curves.dart
index 632414a..f344fa5 100644
--- a/packages/flutter/lib/src/animation/curves.dart
+++ b/packages/flutter/lib/src/animation/curves.dart
@@ -182,7 +182,7 @@
     assert(end >= 0.0);
     assert(end <= 1.0);
     assert(end >= begin);
-    t = ((t - begin) / (end - begin)).clamp(0.0, 1.0) as double;
+    t = ((t - begin) / (end - begin)).clamp(0.0, 1.0) as double; // ignore: unnecessary_cast
     if (t == 0.0 || t == 1.0)
       return t;
     return curve.transform(t);
@@ -1189,7 +1189,7 @@
   double transformInternal(double t) {
     final double s = period / 4.0;
     t = t - 1.0;
-    return -math.pow(2.0, 10.0 * t) * math.sin((t - s) * (math.pi * 2.0) / period) as double;
+    return -math.pow(2.0, 10.0 * t) * math.sin((t - s) * (math.pi * 2.0) / period) as double; // ignore: unnecessary_cast
   }
 
   @override
@@ -1216,7 +1216,7 @@
   @override
   double transformInternal(double t) {
     final double s = period / 4.0;
-    return math.pow(2.0, -10 * t) * math.sin((t - s) * (math.pi * 2.0) / period) + 1.0 as double;
+    return math.pow(2.0, -10 * t) * math.sin((t - s) * (math.pi * 2.0) / period) + 1.0 as double; // ignore: unnecessary_cast
   }
 
   @override
@@ -1248,7 +1248,7 @@
     if (t < 0.0)
       return -0.5 * math.pow(2.0, 10.0 * t) * math.sin((t - s) * (math.pi * 2.0) / period);
     else
-      return math.pow(2.0, -10.0 * t) * math.sin((t - s) * (math.pi * 2.0) / period) * 0.5 + 1.0 as double;
+      return math.pow(2.0, -10.0 * t) * math.sin((t - s) * (math.pi * 2.0) / period) * 0.5 + 1.0 as double; // ignore: unnecessary_cast
   }
 
   @override
diff --git a/packages/flutter/lib/src/gestures/force_press.dart b/packages/flutter/lib/src/gestures/force_press.dart
index 4f47020..899ab10 100644
--- a/packages/flutter/lib/src/gestures/force_press.dart
+++ b/packages/flutter/lib/src/gestures/force_press.dart
@@ -341,7 +341,7 @@
     // If the device incorrectly reports a pressure outside of pressureMin
     // and pressureMax, we still want this recognizer to respond normally.
     if (!value.isNaN)
-      value = value.clamp(0.0, 1.0) as double;
+      value = value.clamp(0.0, 1.0) as double; // ignore: unnecessary_cast
     return value;
   }
 
diff --git a/packages/flutter/lib/src/painting/colors.dart b/packages/flutter/lib/src/painting/colors.dart
index 8ac89e8..75c7183 100644
--- a/packages/flutter/lib/src/painting/colors.dart
+++ b/packages/flutter/lib/src/painting/colors.dart
@@ -207,10 +207,10 @@
     if (b == null)
       return a._scaleAlpha(1.0 - t);
     return HSVColor.fromAHSV(
-      lerpDouble(a.alpha, b.alpha, t)!.clamp(0.0, 1.0) as double,
+      lerpDouble(a.alpha, b.alpha, t)!.clamp(0.0, 1.0) as double, // ignore: unnecessary_cast
       lerpDouble(a.hue, b.hue, t)! % 360.0,
-      lerpDouble(a.saturation, b.saturation, t)!.clamp(0.0, 1.0) as double,
-      lerpDouble(a.value, b.value, t)!.clamp(0.0, 1.0) as double,
+      lerpDouble(a.saturation, b.saturation, t)!.clamp(0.0, 1.0) as double, // ignore: unnecessary_cast
+      lerpDouble(a.value, b.value, t)!.clamp(0.0, 1.0) as double, // ignore: unnecessary_cast
     );
   }
 
@@ -291,7 +291,7 @@
     // Saturation can exceed 1.0 with rounding errors, so clamp it.
     final double saturation = lightness == 1.0
       ? 0.0
-      : ((delta / (1.0 - (2.0 * lightness - 1.0).abs())).clamp(0.0, 1.0) as double);
+      : ((delta / (1.0 - (2.0 * lightness - 1.0).abs())).clamp(0.0, 1.0) as double); // ignore: unnecessary_cast
     return HSLColor.fromAHSL(alpha, hue, saturation, lightness);
   }
 
@@ -391,10 +391,10 @@
     if (b == null)
       return a._scaleAlpha(1.0 - t);
     return HSLColor.fromAHSL(
-      lerpDouble(a.alpha, b.alpha, t)!.clamp(0.0, 1.0) as double,
+      lerpDouble(a.alpha, b.alpha, t)!.clamp(0.0, 1.0) as double, // ignore: unnecessary_cast
       lerpDouble(a.hue, b.hue, t)! % 360.0,
-      lerpDouble(a.saturation, b.saturation, t)!.clamp(0.0, 1.0) as double,
-      lerpDouble(a.lightness, b.lightness, t)!.clamp(0.0, 1.0) as double,
+      lerpDouble(a.saturation, b.saturation, t)!.clamp(0.0, 1.0) as double, // ignore: unnecessary_cast
+      lerpDouble(a.lightness, b.lightness, t)!.clamp(0.0, 1.0) as double, // ignore: unnecessary_cast
     );
   }
 
diff --git a/packages/flutter/lib/src/painting/edge_insets.dart b/packages/flutter/lib/src/painting/edge_insets.dart
index 82f4283..8e5cef8 100644
--- a/packages/flutter/lib/src/painting/edge_insets.dart
+++ b/packages/flutter/lib/src/painting/edge_insets.dart
@@ -162,12 +162,12 @@
   /// or equal to `min`, and less than or equal to `max`.
   EdgeInsetsGeometry clamp(EdgeInsetsGeometry min, EdgeInsetsGeometry max) {
     return _MixedEdgeInsets.fromLRSETB(
-      _left.clamp(min._left, max._left) as double,
-      _right.clamp(min._right, max._right) as double,
-      _start.clamp(min._start, max._start) as double,
-      _end.clamp(min._end, max._end) as double,
-      _top.clamp(min._top, max._top) as double,
-      _bottom.clamp(min._bottom, max._bottom) as double,
+      _left.clamp(min._left, max._left) as double, // ignore: unnecessary_cast
+      _right.clamp(min._right, max._right) as double, // ignore: unnecessary_cast
+      _start.clamp(min._start, max._start) as double, // ignore: unnecessary_cast
+      _end.clamp(min._end, max._end) as double, // ignore: unnecessary_cast
+      _top.clamp(min._top, max._top) as double, // ignore: unnecessary_cast
+      _bottom.clamp(min._bottom, max._bottom) as double, // ignore: unnecessary_cast
     );
   }
 
@@ -506,10 +506,10 @@
   @override
   EdgeInsetsGeometry clamp(EdgeInsetsGeometry min, EdgeInsetsGeometry max) {
     return EdgeInsets.fromLTRB(
-      _left.clamp(min._left, max._left) as double,
-      _top.clamp(min._top, max._top) as double,
-      _right.clamp(min._right, max._right) as double,
-      _bottom.clamp(min._bottom, max._bottom) as double,
+      _left.clamp(min._left, max._left) as double, // ignore: unnecessary_cast
+      _top.clamp(min._top, max._top) as double, // ignore: unnecessary_cast
+      _right.clamp(min._right, max._right) as double, // ignore: unnecessary_cast
+      _bottom.clamp(min._bottom, max._bottom) as double, // ignore: unnecessary_cast
     );
   }
 
diff --git a/packages/flutter/lib/src/painting/flutter_logo.dart b/packages/flutter/lib/src/painting/flutter_logo.dart
index 151d753..ee4cf6f 100644
--- a/packages/flutter/lib/src/painting/flutter_logo.dart
+++ b/packages/flutter/lib/src/painting/flutter_logo.dart
@@ -139,7 +139,7 @@
       t < 0.5 ? a.style : b.style,
       EdgeInsets.lerp(a.margin, b.margin, t)!,
       a._position + (b._position - a._position) * t,
-      (a._opacity + (b._opacity - a._opacity) * t).clamp(0.0, 1.0) as double,
+      (a._opacity + (b._opacity - a._opacity) * t).clamp(0.0, 1.0) as double, // ignore: unnecessary_cast
     );
   }
 
diff --git a/packages/flutter/lib/src/painting/geometry.dart b/packages/flutter/lib/src/painting/geometry.dart
index 9501e6f..757bfca 100644
--- a/packages/flutter/lib/src/painting/geometry.dart
+++ b/packages/flutter/lib/src/painting/geometry.dart
@@ -65,7 +65,7 @@
   if (size.width - margin * 2.0 < childSize.width) {
     x = (size.width - childSize.width) / 2.0;
   } else {
-    final double normalizedTargetX = target.dx.clamp(margin, size.width - margin) as double;
+    final double normalizedTargetX = target.dx.clamp(margin, size.width - margin) as double; // ignore: unnecessary_cast
     final double edge = margin + childSize.width / 2.0;
     if (normalizedTargetX < edge) {
       x = margin;
diff --git a/packages/flutter/lib/src/painting/text_painter.dart b/packages/flutter/lib/src/painting/text_painter.dart
index 669f1ec..1c26957 100644
--- a/packages/flutter/lib/src/painting/text_painter.dart
+++ b/packages/flutter/lib/src/painting/text_painter.dart
@@ -580,7 +580,7 @@
           newWidth = maxIntrinsicWidth;
           break;
       }
-      newWidth = newWidth.clamp(minWidth, maxWidth) as double;
+      newWidth = newWidth.clamp(minWidth, maxWidth) as double; // ignore: unnecessary_cast
       if (newWidth != _applyFloatingPointHack(_paragraph!.width)) {
         _paragraph!.layout(ui.ParagraphConstraints(width: newWidth));
       }
diff --git a/packages/flutter/lib/src/painting/text_style.dart b/packages/flutter/lib/src/painting/text_style.dart
index e62cfc9..fd9b227 100644
--- a/packages/flutter/lib/src/painting/text_style.dart
+++ b/packages/flutter/lib/src/painting/text_style.dart
@@ -839,7 +839,7 @@
       fontFamily: fontFamily ?? this.fontFamily,
       fontFamilyFallback: fontFamilyFallback ?? this.fontFamilyFallback,
       fontSize: fontSize == null ? null : fontSize! * fontSizeFactor + fontSizeDelta,
-      fontWeight: fontWeight == null ? null : FontWeight.values[(fontWeight!.index + fontWeightDelta).clamp(0, FontWeight.values.length - 1) as int],
+      fontWeight: fontWeight == null ? null : FontWeight.values[(fontWeight!.index + fontWeightDelta).clamp(0, FontWeight.values.length - 1) as int], // ignore: unnecessary_cast
       fontStyle: fontStyle ?? this.fontStyle,
       letterSpacing: letterSpacing == null ? null : letterSpacing! * letterSpacingFactor + letterSpacingDelta,
       wordSpacing: wordSpacing == null ? null : wordSpacing! * wordSpacingFactor + wordSpacingDelta,
diff --git a/packages/flutter/lib/src/physics/clamped_simulation.dart b/packages/flutter/lib/src/physics/clamped_simulation.dart
index d5fa6e2..c468671 100644
--- a/packages/flutter/lib/src/physics/clamped_simulation.dart
+++ b/packages/flutter/lib/src/physics/clamped_simulation.dart
@@ -48,10 +48,10 @@
   final double dxMax;
 
   @override
-  double x(double time) => simulation.x(time).clamp(xMin, xMax) as double;
+  double x(double time) => simulation.x(time).clamp(xMin, xMax) as double; // ignore: unnecessary_cast
 
   @override
-  double dx(double time) => simulation.dx(time).clamp(dxMin, dxMax) as double;
+  double dx(double time) => simulation.dx(time).clamp(dxMin, dxMax) as double; // ignore: unnecessary_cast
 
   @override
   bool isDone(double time) => simulation.isDone(time);
diff --git a/packages/flutter/lib/src/physics/friction_simulation.dart b/packages/flutter/lib/src/physics/friction_simulation.dart
index a416c78..747828d 100644
--- a/packages/flutter/lib/src/physics/friction_simulation.dart
+++ b/packages/flutter/lib/src/physics/friction_simulation.dart
@@ -116,7 +116,7 @@
 
   @override
   double x(double time) {
-    return super.x(time).clamp(_minX, _maxX) as double;
+    return super.x(time).clamp(_minX, _maxX) as double; // ignore: unnecessary_cast
   }
 
   @override