Return a valid result for a view with zero width/height in TestViewConfiguration._getMatrix (#157068)

Fixes https://github.com/flutter/flutter/issues/157018
This commit is contained in:
Jason Simmons
2024-10-16 18:14:22 -07:00
committed by GitHub
parent 23a721f9e9
commit 62414ee44e
2 changed files with 11 additions and 1 deletions

View File

@@ -24,6 +24,12 @@ void main() {
// The code below will throw without the default.
TestViewConfiguration(size: const Size(1280.0, 800.0));
});
test('toMatrix handles zero size', () {
// The code below will throw without the default.
final Matrix4 matrix = TestViewConfiguration(size: Size.zero).toMatrix();
expect(matrix.storage.every((double x) => x.isFinite), isTrue);
});
});
group(AutomatedTestWidgetsFlutterBinding, () {