-
Notifications
You must be signed in to change notification settings - Fork 26.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow changing a clipper's type (ShapeBorderClipper,_BottomAppBarClipper). #14937
Conversation
…per). The downcast was crashing when toggling hasNotch for BottomAppBar.
@@ -86,6 +86,37 @@ void main() { | |||
expect(physicalShape.color, const Color(0xff0000ff)); | |||
}); | |||
|
|||
testWidgets('toggle hasNotch', (WidgetTester tester) async { | |||
await tester.pumpWidget( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A comment explaining why we're toggling hasNotch...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
LGTM |
bool shouldReclip(covariant _BottomAppBarClipper oldClipper) { | ||
return oldClipper.geometry != geometry; | ||
bool shouldReclip(CustomClipper<Path> oldClipper) { | ||
if (oldClipper.runtimeType != _BottomAppBarClipper) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is impossible. oldClipped is guaranteed to have the same runtimeType as this
(unless there's a bug in the code that calls shouldReclip
, which is possible)
I think this fix is incorrect. The |
…per). (flutter#14937) The downcast was crashing when toggling hasNotch for BottomAppBar.
cc @amirh see comment above |
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 flutter#14937 worked around. This also reverts the workaround introduced in flutter#14937.
Looks like there was indeed a bug in _RenderCustomClip, sent a fix in #18248. |
The downcast was crashing when toggling hasNotch for BottomAppBar.