Repository navigation
[material_ui] Add more 0x0 size tests part 14 - #13107
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds tests to verify that several Material widgets, including ButtonBar, FilterChip, MaterialButton, MergeableMaterial, and RawMaterialButton, do not crash when rendered with zero area. The feedback suggests refactoring the MergeableMaterial test to use SizedBox.shrink for consistency with the other added tests, rather than modifying the global physical size of the tester view.
| testWidgets('MergeableMaterial does not crash at zero area', (WidgetTester tester) async { | ||
| tester.view.physicalSize = Size.zero; | ||
| addTearDown(tester.view.reset); | ||
| await tester.pumpWidget( | ||
| const MaterialApp( | ||
| home: Scaffold(body: SingleChildScrollView(child: MergeableMaterial())), | ||
| ), | ||
| ); | ||
| expect(tester.getSize(find.byType(MergeableMaterial)), Size.zero); | ||
| }); |
There was a problem hiding this comment.
For consistency with the other tests added in this PR (which use SizedBox.shrink to constrain the widget to zero area), we can wrap MergeableMaterial in a SizedBox.shrink instead of modifying the global tester.view.physicalSize and registering a tear-down. This makes the test simpler, more readable, and avoids potential side effects on the test environment.
testWidgets('MergeableMaterial does not crash at zero area', (WidgetTester tester) async {
await tester.pumpWidget(
const MaterialApp(
home: Scaffold(
body: Center(
child: SizedBox.shrink(
child: MergeableMaterial(),
),
),
),
),
);
expect(tester.getSize(find.byType(MergeableMaterial)), Size.zero);
});flutter/packages@d8d9e97...a1ed23c 2026-10-13 molchanovia.dev@gmail.com [material_ui] Clarify Slider labels for continuous sliders (flutter/packages#13121) 2026-10-12 magder@google.com [in_app_purchase_storekit] Remove availability checks below the package minimum iOS 13 and macOS 10.15 (flutter/packages#13217) 2026-10-12 stuartmorgan@google.com [google_sign_in] Convert unit tests to Kotlin (flutter/packages#13000) 2026-10-12 37883572+edwin-hollen@users.noreply.github.com [vector_graphics_compiler] Support SVG alpha masks (mask-type="alpha") (flutter/packages#13025) 2026-10-11 happytoday83@naver.com [camera_platform_interface] Add zero-shutter-lag API (flutter/packages#12996) 2026-10-10 81666173+matasb-google@users.noreply.github.com [material_ui] Ensure textScaler is taken into account for SnackBar action overflow (flutter/packages#12737) 2026-10-10 ahmedsameha1@gmail.com [material_ui] Add more 0x0 size tests part 14 (flutter/packages#13107) 2026-10-10 44747303+theprantadutta@users.noreply.github.com [cupertino_ui] Fix CupertinoPicker throwing when disposed during the tap-to-select animation (flutter/packages#13012) 2026-10-09 engine-flutter-autoroll@skia.org Roll Flutter (stable) from 5fc3468 to abaf9c5 (3 revisions) (flutter/packages#13186) If this roll has caused a breakage, revert this CL and set the roller to dry run mode using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC flutter-ecosystem@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
flutter/packages@d8d9e97...a1ed23c 2026-10-13 molchanovia.dev@gmail.com [material_ui] Clarify Slider labels for continuous sliders (flutter/packages#13121) 2026-10-12 magder@google.com [in_app_purchase_storekit] Remove availability checks below the package minimum iOS 13 and macOS 10.15 (flutter/packages#13217) 2026-10-12 stuartmorgan@google.com [google_sign_in] Convert unit tests to Kotlin (flutter/packages#13000) 2026-10-12 37883572+edwin-hollen@users.noreply.github.com [vector_graphics_compiler] Support SVG alpha masks (mask-type="alpha") (flutter/packages#13025) 2026-10-11 happytoday83@naver.com [camera_platform_interface] Add zero-shutter-lag API (flutter/packages#12996) 2026-10-10 81666173+matasb-google@users.noreply.github.com [material_ui] Ensure textScaler is taken into account for SnackBar action overflow (flutter/packages#12737) 2026-10-10 ahmedsameha1@gmail.com [material_ui] Add more 0x0 size tests part 14 (flutter/packages#13107) 2026-10-10 44747303+theprantadutta@users.noreply.github.com [cupertino_ui] Fix CupertinoPicker throwing when disposed during the tap-to-select animation (flutter/packages#13012) 2026-10-09 engine-flutter-autoroll@skia.org Roll Flutter (stable) from 5fc3468 to abaf9c5 (3 revisions) (flutter/packages#13186) If this roll has caused a breakage, revert this CL and set the roller to dry run mode using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC flutter-ecosystem@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
This is my attempt to handle flutter/flutter#6537 for the following widgets:
ButtonBar
MaterialButton
RawMaterialButton
FilterChip
MergeableMaterial