_markNeedsClip() when clipper type has changed. (#18248)
A bug in _RenderCustomClip was compaeing the type of oldClipper to
itself instead to the type of newClipper.
This was the root cause for the crash #14937 worked around.
This also reverts the workaround introduced in #14937.
diff --git a/packages/flutter/lib/src/material/bottom_app_bar.dart b/packages/flutter/lib/src/material/bottom_app_bar.dart
index b5c008c..ad4ad56 100644
--- a/packages/flutter/lib/src/material/bottom_app_bar.dart
+++ b/packages/flutter/lib/src/material/bottom_app_bar.dart
@@ -154,11 +154,5 @@
}
@override
- bool shouldReclip(CustomClipper<Path> oldClipper) {
- if (oldClipper.runtimeType != _BottomAppBarClipper)
- return true;
-
- final _BottomAppBarClipper typedOldClipper = oldClipper;
- return typedOldClipper.geometry != geometry;
- }
+ bool shouldReclip(_BottomAppBarClipper oldClipper) => oldClipper.geometry != geometry;
}
diff --git a/packages/flutter/lib/src/rendering/proxy_box.dart b/packages/flutter/lib/src/rendering/proxy_box.dart
index 3e0c499..ecbaf6f 100644
--- a/packages/flutter/lib/src/rendering/proxy_box.dart
+++ b/packages/flutter/lib/src/rendering/proxy_box.dart
@@ -1106,7 +1106,7 @@
_clipper = newClipper;
assert(newClipper != null || oldClipper != null);
if (newClipper == null || oldClipper == null ||
- oldClipper.runtimeType != oldClipper.runtimeType ||
+ newClipper.runtimeType != oldClipper.runtimeType ||
newClipper.shouldReclip(oldClipper)) {
_markNeedsClip();
}