From 0a26ac09703b92a939fe3340c0584657a1791566 Mon Sep 17 00:00:00 2001 From: amirh Date: Wed, 6 Jun 2018 15:28:20 -0700 Subject: [PATCH] _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. --- packages/flutter/lib/src/material/bottom_app_bar.dart | 8 +------- packages/flutter/lib/src/rendering/proxy_box.dart | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/packages/flutter/lib/src/material/bottom_app_bar.dart b/packages/flutter/lib/src/material/bottom_app_bar.dart index b5c008c424..ad4ad563ef 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 @@ class _BottomAppBarClipper extends CustomClipper { } @override - bool shouldReclip(CustomClipper 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 3e0c49901d..ecbaf6f0be 100644 --- a/packages/flutter/lib/src/rendering/proxy_box.dart +++ b/packages/flutter/lib/src/rendering/proxy_box.dart @@ -1106,7 +1106,7 @@ abstract class _RenderCustomClip extends RenderProxyBox { _clipper = newClipper; assert(newClipper != null || oldClipper != null); if (newClipper == null || oldClipper == null || - oldClipper.runtimeType != oldClipper.runtimeType || + newClipper.runtimeType != oldClipper.runtimeType || newClipper.shouldReclip(oldClipper)) { _markNeedsClip(); }