Make sure that a CupertinoListTile doesn't crash in 0x0 environment#179109
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds a regression test to ensure that CupertinoListTile does not crash when rendered in a zero-sized environment, addressing a previously reported issue. The added test is well-structured and correctly simulates the problematic scenario. I have suggested a minor enhancement to the test to more closely match the conditions of the original bug report, which involved a leading widget.
| await tester.pumpWidget( | ||
| const CupertinoApp( | ||
| home: Center( | ||
| child: SizedBox.shrink(child: CupertinoListTile(title: Text('X'))), |
There was a problem hiding this comment.
This is a good regression test. To better cover the scenario described in the original issue, which was related to calculations involving the leading widget, I suggest also testing the case where a leading widget is present. This will make the test more robust against future regressions related to this part of the layout logic.
| child: SizedBox.shrink(child: CupertinoListTile(title: Text('X'))), | |
| child: SizedBox.shrink(child: CupertinoListTile(title: Text('X'), leading: Icon(CupertinoIcons.add))), |
| const CupertinoApp( | ||
| home: Center( | ||
| child: SizedBox.shrink( | ||
| child: CupertinoListTile(title: Text('X'), trailing: CupertinoListTileChevron()), |
There was a problem hiding this comment.
I think it puts the chevron in by default? My request was we should expect that the chevron is correctly shrunk.
There was a problem hiding this comment.
Do you want me to assert that the size of the CupertinoListTileChevron is zero here?
There was a problem hiding this comment.
I think this test is fine since we only want to verify that ListTile has size zero.
dkwingsmt
left a comment
There was a problem hiding this comment.
Checklist:
- The test is in the correct file
- The test name goes “does not crash at zero area”
- The target widget is wrapped by
Center(or is fullscreen) - The target widget does not have an overlay, or the overlay is tested
- The target widget is expected to have a size of exactly
Size.zero
| const CupertinoApp( | ||
| home: Center( | ||
| child: SizedBox.shrink( | ||
| child: CupertinoListTile(title: Text('X'), trailing: CupertinoListTileChevron()), |
There was a problem hiding this comment.
I think this test is fine since we only want to verify that ListTile has size zero.
…lutter#179109) This is my attempt to handle flutter#6537 for the CupertinoListTile widget. --------- Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
Manual roll requested by tarrinneal@google.com flutter/flutter@b2de367...6a1f5b7 2025-12-09 31510811+jwlilly@users.noreply.github.com Fix - Semantics focus does not move outside viewport when moving up or down (flutter/flutter#179480) 2025-12-09 ahmedsameha1@gmail.com Make sure that a CupertinoActionSheetAction doesn't crash in 0x0 envi… (flutter/flutter#178955) 2025-12-09 ahmedsameha1@gmail.com Make sure that a CupertinoPickerDefaultSelectionOverlay doesn't crash… (flutter/flutter#179351) 2025-12-09 ahmedsameha1@gmail.com Make sure that a CupertinoExpansionTile doesn't crash in 0x0 environment (flutter/flutter#178978) 2025-12-09 engine-flutter-autoroll@skia.org Roll Packages from 33a9a81 to 338ecd3 (5 revisions) (flutter/flutter#179625) 2025-12-09 kjlubick@users.noreply.github.com [skia] Update SkSerialProcs to use new type (flutter/flutter#179347) 2025-12-09 engine-flutter-autoroll@skia.org Roll Skia from 895fa7417947 to 502ee6f2a0d7 (4 revisions) (flutter/flutter#179617) 2025-12-09 engine-flutter-autoroll@skia.org Roll Skia from 9f276dfa0bdc to 895fa7417947 (1 revision) (flutter/flutter#179608) 2025-12-09 1961493+harryterkelsen@users.noreply.github.com Remove unused optional argument in _followDiagnosticableChain (flutter/flutter#179525) 2025-12-08 engine-flutter-autoroll@skia.org Roll Dart SDK from 3c07646cdcb9 to 019cb923bf62 (1 revision) (flutter/flutter#179595) 2025-12-08 fluttergithubbot@gmail.com Marks Linux_mokey flutter_engine_group_performance to be flaky (flutter/flutter#179115) 2025-12-08 engine-flutter-autoroll@skia.org Roll Skia from 00e6fc407968 to 9f276dfa0bdc (3 revisions) (flutter/flutter#179594) 2025-12-08 fluttergithubbot@gmail.com Marks Mac_arm64_mokey run_release_test to be flaky (flutter/flutter#177372) 2025-12-08 engine-flutter-autoroll@skia.org Roll Skia from b1936c760645 to 00e6fc407968 (5 revisions) (flutter/flutter#179589) 2025-12-08 kevmoo@users.noreply.github.com MatrixUtils.forceToPoint - simplify and optimize (flutter/flutter#179546) 2025-12-08 97480502+b-luk@users.noreply.github.com Change GenerateFilledArcStrip to use non-overlapping triangles (flutter/flutter#179292) 2025-12-08 matt.boetger@gmail.com Android implementation of content sizing (flutter/flutter#176063) 2025-12-08 engine-flutter-autoroll@skia.org Roll Dart SDK from 75899721aa42 to 3c07646cdcb9 (1 revision) (flutter/flutter#179587) 2025-12-08 matt.boetger@gmail.com Redistribute TESTOWNERS for Android team (flutter/flutter#179464) 2025-12-08 ahmedsameha1@gmail.com Make sure that a CupertinoListTile doesn't crash in 0x0 environment (flutter/flutter#179109) 2025-12-08 ahmedsameha1@gmail.com Make sure that a CupertinoFocusHalo doesn't crash in 0x0 environment (flutter/flutter#178773) 2025-12-08 ahmedsameha1@gmail.com Make sure that a CupertinoPopupSurface doesn't crash in 0x0 environment (flutter/flutter#178929) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC stuartmorgan@google.com,tarrinneal@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Packages: 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
…0593) Manual roll requested by tarrinneal@google.com flutter/flutter@b2de367...6a1f5b7 2025-12-09 31510811+jwlilly@users.noreply.github.com Fix - Semantics focus does not move outside viewport when moving up or down (flutter/flutter#179480) 2025-12-09 ahmedsameha1@gmail.com Make sure that a CupertinoActionSheetAction doesn't crash in 0x0 envi… (flutter/flutter#178955) 2025-12-09 ahmedsameha1@gmail.com Make sure that a CupertinoPickerDefaultSelectionOverlay doesn't crash… (flutter/flutter#179351) 2025-12-09 ahmedsameha1@gmail.com Make sure that a CupertinoExpansionTile doesn't crash in 0x0 environment (flutter/flutter#178978) 2025-12-09 engine-flutter-autoroll@skia.org Roll Packages from 33a9a81 to 338ecd3 (5 revisions) (flutter/flutter#179625) 2025-12-09 kjlubick@users.noreply.github.com [skia] Update SkSerialProcs to use new type (flutter/flutter#179347) 2025-12-09 engine-flutter-autoroll@skia.org Roll Skia from 895fa7417947 to 502ee6f2a0d7 (4 revisions) (flutter/flutter#179617) 2025-12-09 engine-flutter-autoroll@skia.org Roll Skia from 9f276dfa0bdc to 895fa7417947 (1 revision) (flutter/flutter#179608) 2025-12-09 1961493+harryterkelsen@users.noreply.github.com Remove unused optional argument in _followDiagnosticableChain (flutter/flutter#179525) 2025-12-08 engine-flutter-autoroll@skia.org Roll Dart SDK from 3c07646cdcb9 to 019cb923bf62 (1 revision) (flutter/flutter#179595) 2025-12-08 fluttergithubbot@gmail.com Marks Linux_mokey flutter_engine_group_performance to be flaky (flutter/flutter#179115) 2025-12-08 engine-flutter-autoroll@skia.org Roll Skia from 00e6fc407968 to 9f276dfa0bdc (3 revisions) (flutter/flutter#179594) 2025-12-08 fluttergithubbot@gmail.com Marks Mac_arm64_mokey run_release_test to be flaky (flutter/flutter#177372) 2025-12-08 engine-flutter-autoroll@skia.org Roll Skia from b1936c760645 to 00e6fc407968 (5 revisions) (flutter/flutter#179589) 2025-12-08 kevmoo@users.noreply.github.com MatrixUtils.forceToPoint - simplify and optimize (flutter/flutter#179546) 2025-12-08 97480502+b-luk@users.noreply.github.com Change GenerateFilledArcStrip to use non-overlapping triangles (flutter/flutter#179292) 2025-12-08 matt.boetger@gmail.com Android implementation of content sizing (flutter/flutter#176063) 2025-12-08 engine-flutter-autoroll@skia.org Roll Dart SDK from 75899721aa42 to 3c07646cdcb9 (1 revision) (flutter/flutter#179587) 2025-12-08 matt.boetger@gmail.com Redistribute TESTOWNERS for Android team (flutter/flutter#179464) 2025-12-08 ahmedsameha1@gmail.com Make sure that a CupertinoListTile doesn't crash in 0x0 environment (flutter/flutter#179109) 2025-12-08 ahmedsameha1@gmail.com Make sure that a CupertinoFocusHalo doesn't crash in 0x0 environment (flutter/flutter#178773) 2025-12-08 ahmedsameha1@gmail.com Make sure that a CupertinoPopupSurface doesn't crash in 0x0 environment (flutter/flutter#178929) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC stuartmorgan@google.com,tarrinneal@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Packages: 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
…0593) Manual roll requested by tarrinneal@google.com flutter/flutter@b2de367...6a1f5b7 2025-12-09 31510811+jwlilly@users.noreply.github.com Fix - Semantics focus does not move outside viewport when moving up or down (flutter/flutter#179480) 2025-12-09 ahmedsameha1@gmail.com Make sure that a CupertinoActionSheetAction doesn't crash in 0x0 envi… (flutter/flutter#178955) 2025-12-09 ahmedsameha1@gmail.com Make sure that a CupertinoPickerDefaultSelectionOverlay doesn't crash… (flutter/flutter#179351) 2025-12-09 ahmedsameha1@gmail.com Make sure that a CupertinoExpansionTile doesn't crash in 0x0 environment (flutter/flutter#178978) 2025-12-09 engine-flutter-autoroll@skia.org Roll Packages from 33a9a81 to 338ecd3 (5 revisions) (flutter/flutter#179625) 2025-12-09 kjlubick@users.noreply.github.com [skia] Update SkSerialProcs to use new type (flutter/flutter#179347) 2025-12-09 engine-flutter-autoroll@skia.org Roll Skia from 895fa7417947 to 502ee6f2a0d7 (4 revisions) (flutter/flutter#179617) 2025-12-09 engine-flutter-autoroll@skia.org Roll Skia from 9f276dfa0bdc to 895fa7417947 (1 revision) (flutter/flutter#179608) 2025-12-09 1961493+harryterkelsen@users.noreply.github.com Remove unused optional argument in _followDiagnosticableChain (flutter/flutter#179525) 2025-12-08 engine-flutter-autoroll@skia.org Roll Dart SDK from 3c07646cdcb9 to 019cb923bf62 (1 revision) (flutter/flutter#179595) 2025-12-08 fluttergithubbot@gmail.com Marks Linux_mokey flutter_engine_group_performance to be flaky (flutter/flutter#179115) 2025-12-08 engine-flutter-autoroll@skia.org Roll Skia from 00e6fc407968 to 9f276dfa0bdc (3 revisions) (flutter/flutter#179594) 2025-12-08 fluttergithubbot@gmail.com Marks Mac_arm64_mokey run_release_test to be flaky (flutter/flutter#177372) 2025-12-08 engine-flutter-autoroll@skia.org Roll Skia from b1936c760645 to 00e6fc407968 (5 revisions) (flutter/flutter#179589) 2025-12-08 kevmoo@users.noreply.github.com MatrixUtils.forceToPoint - simplify and optimize (flutter/flutter#179546) 2025-12-08 97480502+b-luk@users.noreply.github.com Change GenerateFilledArcStrip to use non-overlapping triangles (flutter/flutter#179292) 2025-12-08 matt.boetger@gmail.com Android implementation of content sizing (flutter/flutter#176063) 2025-12-08 engine-flutter-autoroll@skia.org Roll Dart SDK from 75899721aa42 to 3c07646cdcb9 (1 revision) (flutter/flutter#179587) 2025-12-08 matt.boetger@gmail.com Redistribute TESTOWNERS for Android team (flutter/flutter#179464) 2025-12-08 ahmedsameha1@gmail.com Make sure that a CupertinoListTile doesn't crash in 0x0 environment (flutter/flutter#179109) 2025-12-08 ahmedsameha1@gmail.com Make sure that a CupertinoFocusHalo doesn't crash in 0x0 environment (flutter/flutter#178773) 2025-12-08 ahmedsameha1@gmail.com Make sure that a CupertinoPopupSurface doesn't crash in 0x0 environment (flutter/flutter#178929) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC stuartmorgan@google.com,tarrinneal@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Packages: 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 #6537 for the CupertinoListTile widget.