Add more 0x0 size tests part 9#185625
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds regression tests for BackdropFilter, Clip widgets, CustomPaint, PhysicalModel, PhysicalShape, and Transform to ensure they do not crash when rendered with zero area. Feedback suggests simplifying the ClipRect test and removing unused ValueNotifier variables and disposal logic in several clipping tests to improve consistency and remove redundant code.
| final clip = ValueNotifier<Rect>(const Rect.fromLTWH(50.0, 50.0, 100.0, 100.0)); | ||
| addTearDown(tester.view.reset); | ||
| addTearDown(clip.dispose); | ||
| await tester.pumpWidget( | ||
| Directionality( | ||
| textDirection: TextDirection.ltr, | ||
| child: Center( | ||
| child: ClipRect(clipper: NotifyClipper<Rect>(clip: clip)), | ||
| ), | ||
| ), | ||
| ); |
There was a problem hiding this comment.
This test can be simplified by removing the ValueNotifier and the custom clipper, as they are not necessary to verify that the widget does not crash at zero area. This also makes the test consistent with the others in this file.
addTearDown(tester.view.reset);
await tester.pumpWidget(
const Directionality(
textDirection: TextDirection.ltr,
child: Center(
child: ClipRect(child: Placeholder()),
),
),
);| final clip = ValueNotifier<Rect>(const Rect.fromLTWH(50.0, 50.0, 100.0, 100.0)); | ||
| addTearDown(tester.view.reset); | ||
| addTearDown(clip.dispose); |
There was a problem hiding this comment.
The clip variable and its disposal are unused in this test. They appear to be leftovers from a copy-paste of the ClipRect test.
addTearDown(tester.view.reset);References
- Write what you need and no more, but when you write it, do it right. (link)
| final clip = ValueNotifier<Rect>(const Rect.fromLTWH(50.0, 50.0, 100.0, 100.0)); | ||
| addTearDown(tester.view.reset); | ||
| addTearDown(clip.dispose); |
There was a problem hiding this comment.
The clip variable and its disposal are unused in this test.
addTearDown(tester.view.reset);References
- Write what you need and no more, but when you write it, do it right. (link)
| final clip = ValueNotifier<Rect>(const Rect.fromLTWH(50.0, 50.0, 100.0, 100.0)); | ||
| addTearDown(tester.view.reset); | ||
| addTearDown(clip.dispose); |
There was a problem hiding this comment.
The clip variable and its disposal are unused in this test.
addTearDown(tester.view.reset);References
- Write what you need and no more, but when you write it, do it right. (link)
| final clip = ValueNotifier<Rect>(const Rect.fromLTWH(50.0, 50.0, 100.0, 100.0)); | ||
| addTearDown(tester.view.reset); | ||
| addTearDown(clip.dispose); |
There was a problem hiding this comment.
The clip variable and its disposal are unused in this test.
addTearDown(tester.view.reset);References
- Write what you need and no more, but when you write it, do it right. (link)
|
autosubmit label was removed for flutter/flutter/185625, because - The status or check suite Mac framework_tests_impeller has failed. Please fix the issues identified (or deflake) before re-applying this label. |
This is my attempt to handle #6537 for the following widgets:
Transform
PhysicalShape
PhysicalModel
ClipPath
ClipOval
ClipRSuperellipse
ClipRRect
ClipRect
CustomPaint
BackdropFilter