Skip to content

Make sure that a CupertinoFocusHalo doesn't crash in 0x0 environment#178773

Merged
auto-submit[bot] merged 3 commits intoflutter:masterfrom
ahmedsameha1:handle#6537-CupertinoFocusHalo
Dec 8, 2025
Merged

Make sure that a CupertinoFocusHalo doesn't crash in 0x0 environment#178773
auto-submit[bot] merged 3 commits intoflutter:masterfrom
ahmedsameha1:handle#6537-CupertinoFocusHalo

Conversation

@ahmedsameha1
Copy link
Contributor

This is my attempt to handle #6537 for the CupertinoFocusHalo widget.

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. f: cupertino flutter/packages/flutter/cupertino repository f: focus Focus traversal, gaining or losing focus labels Nov 19, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a regression test for a crash in CupertinoFocusHalo when it's rendered in a zero-sized area. The intent is correct, but the test as written doesn't actually trigger the crash condition because it fails to set focus on the child widget. My review includes a suggestion to correct the test by explicitly requesting focus, which will ensure the halo is drawn and properly validates the fix.

@ahmedsameha1 ahmedsameha1 force-pushed the handle#6537-CupertinoFocusHalo branch 2 times, most recently from 898c8b6 to 1825d1b Compare November 19, 2025 05:09
version: "2.2.2"
sdks:
dart: ">=3.9.0 <4.0.0"
dart: ">=3.11.0-88.0.dev <4.0.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for including this in the commit!

@ahmedsameha1 ahmedsameha1 force-pushed the handle#6537-CupertinoFocusHalo branch from 1825d1b to 489c9d9 Compare November 19, 2025 11:54
Copy link
Contributor

@dkwingsmt dkwingsmt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@dkwingsmt dkwingsmt requested a review from victorsanni December 5, 2025 21:53
@victorsanni victorsanni added the autosubmit Merge PR when tree becomes green via auto submit App label Dec 8, 2025
@auto-submit auto-submit bot added this pull request to the merge queue Dec 8, 2025
Merged via the queue into flutter:master with commit 07e1cdd Dec 8, 2025
71 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Dec 8, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 9, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 9, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 9, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 9, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 9, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 9, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 10, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 10, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 10, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 10, 2025
reidbaker pushed a commit to AbdeMohlbi/flutter that referenced this pull request Dec 10, 2025
…lutter#178773)

This is my attempt to handle
flutter#6537 for the
CupertinoFocusHalo widget.

---------

Co-authored-by: Tong Mu <[email protected]>
Co-authored-by: Victor Sanni <[email protected]>
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Dec 10, 2025
Manual roll requested by [email protected]

flutter/flutter@b2de367...6a1f5b7

2025-12-09 [email protected] Fix - Semantics focus does not move outside viewport when moving up or down (flutter/flutter#179480)
2025-12-09 [email protected] Make sure that a CupertinoActionSheetAction doesn't crash in 0x0 envi… (flutter/flutter#178955)
2025-12-09 [email protected] Make sure that a CupertinoPickerDefaultSelectionOverlay doesn't crash… (flutter/flutter#179351)
2025-12-09 [email protected] Make sure that a CupertinoExpansionTile doesn't crash in 0x0 environment (flutter/flutter#178978)
2025-12-09 [email protected] Roll Packages from 33a9a81 to 338ecd3 (5 revisions) (flutter/flutter#179625)
2025-12-09 [email protected] [skia] Update SkSerialProcs to use new type (flutter/flutter#179347)
2025-12-09 [email protected] Roll Skia from 895fa7417947 to 502ee6f2a0d7 (4 revisions) (flutter/flutter#179617)
2025-12-09 [email protected] Roll Skia from 9f276dfa0bdc to 895fa7417947 (1 revision) (flutter/flutter#179608)
2025-12-09 [email protected] Remove unused optional argument in _followDiagnosticableChain (flutter/flutter#179525)
2025-12-08 [email protected] Roll Dart SDK from 3c07646cdcb9 to 019cb923bf62 (1 revision) (flutter/flutter#179595)
2025-12-08 [email protected] Marks Linux_mokey flutter_engine_group_performance to be flaky (flutter/flutter#179115)
2025-12-08 [email protected] Roll Skia from 00e6fc407968 to 9f276dfa0bdc (3 revisions) (flutter/flutter#179594)
2025-12-08 [email protected] Marks Mac_arm64_mokey run_release_test to be flaky (flutter/flutter#177372)
2025-12-08 [email protected] Roll Skia from b1936c760645 to 00e6fc407968 (5 revisions) (flutter/flutter#179589)
2025-12-08 [email protected] MatrixUtils.forceToPoint - simplify and optimize (flutter/flutter#179546)
2025-12-08 [email protected] Change GenerateFilledArcStrip to use non-overlapping triangles (flutter/flutter#179292)
2025-12-08 [email protected] Android implementation of content sizing (flutter/flutter#176063)
2025-12-08 [email protected] Roll Dart SDK from 75899721aa42 to 3c07646cdcb9 (1 revision) (flutter/flutter#179587)
2025-12-08 [email protected] Redistribute TESTOWNERS for Android team (flutter/flutter#179464)
2025-12-08 [email protected] Make sure that a CupertinoListTile doesn't crash in 0x0 environment (flutter/flutter#179109)
2025-12-08 [email protected] Make sure that a CupertinoFocusHalo doesn't crash in 0x0 environment (flutter/flutter#178773)
2025-12-08 [email protected] 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 [email protected],[email protected] 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
ivan-vanyusho pushed a commit to ivan-vanyusho/packages that referenced this pull request Jan 26, 2026
…0593)

Manual roll requested by [email protected]

flutter/flutter@b2de367...6a1f5b7

2025-12-09 [email protected] Fix - Semantics focus does not move outside viewport when moving up or down (flutter/flutter#179480)
2025-12-09 [email protected] Make sure that a CupertinoActionSheetAction doesn't crash in 0x0 envi… (flutter/flutter#178955)
2025-12-09 [email protected] Make sure that a CupertinoPickerDefaultSelectionOverlay doesn't crash… (flutter/flutter#179351)
2025-12-09 [email protected] Make sure that a CupertinoExpansionTile doesn't crash in 0x0 environment (flutter/flutter#178978)
2025-12-09 [email protected] Roll Packages from 33a9a81 to 338ecd3 (5 revisions) (flutter/flutter#179625)
2025-12-09 [email protected] [skia] Update SkSerialProcs to use new type (flutter/flutter#179347)
2025-12-09 [email protected] Roll Skia from 895fa7417947 to 502ee6f2a0d7 (4 revisions) (flutter/flutter#179617)
2025-12-09 [email protected] Roll Skia from 9f276dfa0bdc to 895fa7417947 (1 revision) (flutter/flutter#179608)
2025-12-09 [email protected] Remove unused optional argument in _followDiagnosticableChain (flutter/flutter#179525)
2025-12-08 [email protected] Roll Dart SDK from 3c07646cdcb9 to 019cb923bf62 (1 revision) (flutter/flutter#179595)
2025-12-08 [email protected] Marks Linux_mokey flutter_engine_group_performance to be flaky (flutter/flutter#179115)
2025-12-08 [email protected] Roll Skia from 00e6fc407968 to 9f276dfa0bdc (3 revisions) (flutter/flutter#179594)
2025-12-08 [email protected] Marks Mac_arm64_mokey run_release_test to be flaky (flutter/flutter#177372)
2025-12-08 [email protected] Roll Skia from b1936c760645 to 00e6fc407968 (5 revisions) (flutter/flutter#179589)
2025-12-08 [email protected] MatrixUtils.forceToPoint - simplify and optimize (flutter/flutter#179546)
2025-12-08 [email protected] Change GenerateFilledArcStrip to use non-overlapping triangles (flutter/flutter#179292)
2025-12-08 [email protected] Android implementation of content sizing (flutter/flutter#176063)
2025-12-08 [email protected] Roll Dart SDK from 75899721aa42 to 3c07646cdcb9 (1 revision) (flutter/flutter#179587)
2025-12-08 [email protected] Redistribute TESTOWNERS for Android team (flutter/flutter#179464)
2025-12-08 [email protected] Make sure that a CupertinoListTile doesn't crash in 0x0 environment (flutter/flutter#179109)
2025-12-08 [email protected] Make sure that a CupertinoFocusHalo doesn't crash in 0x0 environment (flutter/flutter#178773)
2025-12-08 [email protected] 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 [email protected],[email protected] 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
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

f: cupertino flutter/packages/flutter/cupertino repository f: focus Focus traversal, gaining or losing focus framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants