Skip to content

Make sure that a CheckedModeBanner doesn't crash in 0x0 environment#180280

Merged
auto-submit[bot] merged 1 commit intoflutter:masterfrom
ahmedsameha1:handle#6537-CheckedModeBanner
Dec 30, 2025
Merged

Make sure that a CheckedModeBanner doesn't crash in 0x0 environment#180280
auto-submit[bot] merged 1 commit intoflutter:masterfrom
ahmedsameha1:handle#6537-CheckedModeBanner

Conversation

@ahmedsameha1
Copy link
Contributor

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

@github-actions github-actions bot added the framework flutter/packages/flutter repository. See also f: labels. label Dec 25, 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 issue #6537, where CheckedModeBanner crashes when painting in a zero-sized area. The test correctly reproduces the scenario by wrapping a CheckedModeBanner in a SizedBox.shrink and appears to be well-written. However, the pull request seems to be incomplete as it does not contain the fix for the bug it's testing against. The fix, as suggested in the issue, would likely involve adding a check at the beginning of BannerPainter.paint to return early if the canvas size is empty. Assuming the fix will be added in a subsequent commit, this test is a good addition to prevent future regressions.

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

Copy link
Contributor

@justinmc justinmc left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@justinmc justinmc added the autosubmit Merge PR when tree becomes green via auto submit App label Dec 30, 2025
@auto-submit auto-submit bot added this pull request to the merge queue Dec 30, 2025
Merged via the queue into flutter:master with commit 8d5a463 Dec 30, 2025
71 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Dec 30, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 31, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 31, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 1, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 1, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 2, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 2, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 2, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 3, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 3, 2026
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Jan 4, 2026
Roll Flutter from 60d8165 to 13b2b91 (34 revisions)

flutter/flutter@60d8165...13b2b91

2026-01-03 [email protected] Roll Skia from 229239fde9e9 to 2f257bbea23a (1 revision) (flutter/flutter#180461)
2026-01-03 [email protected] Roll Dart SDK from be125a188f41 to 8e711d05b844 (1 revision) (flutter/flutter#180460)
2026-01-03 [email protected] Roll Dart SDK from 0e6419d14382 to be125a188f41 (1 revision) (flutter/flutter#180454)
2026-01-02 [email protected] Roll Dart SDK from 5e4b7dc3a134 to 0e6419d14382 (4 revisions) (flutter/flutter#180449)
2026-01-02 [email protected] Roll Skia from 5a8d480365e2 to 229239fde9e9 (9 revisions) (flutter/flutter#180448)
2026-01-02 [email protected] Relands "Feat: Add a11y for loading indicators (#165173)" (flutter/flutter#178402)
2026-01-02 [email protected] Add SK_SUPPORT_LEGACY_UNSPANNED_GRADIENTS to SkUserConfig.h (flutter/flutter#180443)
2026-01-02 [email protected] Some cleanup of cross library test imports (flutter/flutter#177029)
2026-01-02 [email protected] Roll Dart SDK from df175c998021 to 5e4b7dc3a134 (1 revision) (flutter/flutter#180366)
2026-01-02 [email protected] Roll Fuchsia Linux SDK from nzgy72aZ9kvHxTDM6... to 1pPgo5DrQ5ITdz3Uy... (flutter/flutter#180438)
2026-01-01 [email protected] Roll Fuchsia Linux SDK from 23suNuzNQCwRbDrys... to nzgy72aZ9kvHxTDM6... (flutter/flutter#180424)
2025-12-31 [email protected] Remove @OverRide annotations from things which are not overrides (flutter/flutter#180417)
2025-12-31 [email protected] Roll Fuchsia Linux SDK from t1eBl_kzKGV5K28OU... to 23suNuzNQCwRbDrys... (flutter/flutter#180409)
2025-12-31 [email protected] Roll Skia from 8851d5318c9d to 5a8d480365e2 (1 revision) (flutter/flutter#180400)
2025-12-31 [email protected] Make sure that a DecoratedBox doesn't crash in 0x0 environment (flutter/flutter#180329)
2025-12-31 [email protected] Roll Skia from d0e12d575173 to 8851d5318c9d (2 revisions) (flutter/flutter#180399)
2025-12-31 [email protected] Improve Container color/decoration error message clarity (flutter/flutter#178823)
2025-12-30 [email protected] Make sure that a CheckedModeBanner doesn't crash in 0x0 environment (flutter/flutter#180280)
2025-12-30 [email protected] Roll Skia from 32c27424accb to d0e12d575173 (1 revision) (flutter/flutter#180394)
2025-12-30 [email protected] [Framework] iOS style blurring and `ImageFilterConfig` (flutter/flutter#175473)
2025-12-30 [email protected] Fix issue with getUniformFloat crashing with hot reload (flutter/flutter#180138)
2025-12-30 [email protected] Test cross import lint (flutter/flutter#178693)
2025-12-30 [email protected] Roll Skia from d64da765cee6 to 32c27424accb (1 revision) (flutter/flutter#180393)
2025-12-30 [email protected] Roll Skia from 4c438e0537fc to d64da765cee6 (1 revision) (flutter/flutter#180390)
2025-12-30 [email protected] Roll Packages from b3c3ca8 to 30dd810 (1 revision) (flutter/flutter#180388)
2025-12-30 [email protected] Roll Skia from 27b587c4b160 to 4c438e0537fc (1 revision) (flutter/flutter#180384)
2025-12-30 [email protected] Roll Fuchsia Linux SDK from DdllqZRZYriOd7Q8v... to t1eBl_kzKGV5K28OU... (flutter/flutter#180378)
2025-12-30 [email protected] Roll Skia from 11690456a90d to 27b587c4b160 (1 revision) (flutter/flutter#180377)
2025-12-30 [email protected] Allow setting vector uniforms by name. (flutter/flutter#179927)
2025-12-30 [email protected] Roll Skia from 7abf754bce14 to 11690456a90d (6 revisions) (flutter/flutter#180374)
2025-12-29 [email protected] Add support for Shift-Delete, Ctrl-Insert and Shift-Insert (flutter/flutter#178561)
2025-12-29 [email protected] Roll Skia from c85d3e2b12d7 to 7abf754bce14 (1 revision) (flutter/flutter#180371)
2025-12-29 [email protected] Roll Packages from 2164da9 to b3c3ca8 (2 revisions) (flutter/flutter#180365)
2025-12-29 [email protected] Roll Skia from c29a475066f5 to c85d3e2b12d7 (1 revision) (flutter/flutter#180363)

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] 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

...
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 4, 2026
ivan-vanyusho pushed a commit to ivan-vanyusho/packages that referenced this pull request Jan 26, 2026
Roll Flutter from 60d8165 to 13b2b91 (34 revisions)

flutter/flutter@60d8165...13b2b91

2026-01-03 [email protected] Roll Skia from 229239fde9e9 to 2f257bbea23a (1 revision) (flutter/flutter#180461)
2026-01-03 [email protected] Roll Dart SDK from be125a188f41 to 8e711d05b844 (1 revision) (flutter/flutter#180460)
2026-01-03 [email protected] Roll Dart SDK from 0e6419d14382 to be125a188f41 (1 revision) (flutter/flutter#180454)
2026-01-02 [email protected] Roll Dart SDK from 5e4b7dc3a134 to 0e6419d14382 (4 revisions) (flutter/flutter#180449)
2026-01-02 [email protected] Roll Skia from 5a8d480365e2 to 229239fde9e9 (9 revisions) (flutter/flutter#180448)
2026-01-02 [email protected] Relands "Feat: Add a11y for loading indicators (#165173)" (flutter/flutter#178402)
2026-01-02 [email protected] Add SK_SUPPORT_LEGACY_UNSPANNED_GRADIENTS to SkUserConfig.h (flutter/flutter#180443)
2026-01-02 [email protected] Some cleanup of cross library test imports (flutter/flutter#177029)
2026-01-02 [email protected] Roll Dart SDK from df175c998021 to 5e4b7dc3a134 (1 revision) (flutter/flutter#180366)
2026-01-02 [email protected] Roll Fuchsia Linux SDK from nzgy72aZ9kvHxTDM6... to 1pPgo5DrQ5ITdz3Uy... (flutter/flutter#180438)
2026-01-01 [email protected] Roll Fuchsia Linux SDK from 23suNuzNQCwRbDrys... to nzgy72aZ9kvHxTDM6... (flutter/flutter#180424)
2025-12-31 [email protected] Remove @OverRide annotations from things which are not overrides (flutter/flutter#180417)
2025-12-31 [email protected] Roll Fuchsia Linux SDK from t1eBl_kzKGV5K28OU... to 23suNuzNQCwRbDrys... (flutter/flutter#180409)
2025-12-31 [email protected] Roll Skia from 8851d5318c9d to 5a8d480365e2 (1 revision) (flutter/flutter#180400)
2025-12-31 [email protected] Make sure that a DecoratedBox doesn't crash in 0x0 environment (flutter/flutter#180329)
2025-12-31 [email protected] Roll Skia from d0e12d575173 to 8851d5318c9d (2 revisions) (flutter/flutter#180399)
2025-12-31 [email protected] Improve Container color/decoration error message clarity (flutter/flutter#178823)
2025-12-30 [email protected] Make sure that a CheckedModeBanner doesn't crash in 0x0 environment (flutter/flutter#180280)
2025-12-30 [email protected] Roll Skia from 32c27424accb to d0e12d575173 (1 revision) (flutter/flutter#180394)
2025-12-30 [email protected] [Framework] iOS style blurring and `ImageFilterConfig` (flutter/flutter#175473)
2025-12-30 [email protected] Fix issue with getUniformFloat crashing with hot reload (flutter/flutter#180138)
2025-12-30 [email protected] Test cross import lint (flutter/flutter#178693)
2025-12-30 [email protected] Roll Skia from d64da765cee6 to 32c27424accb (1 revision) (flutter/flutter#180393)
2025-12-30 [email protected] Roll Skia from 4c438e0537fc to d64da765cee6 (1 revision) (flutter/flutter#180390)
2025-12-30 [email protected] Roll Packages from b3c3ca8 to 30dd810 (1 revision) (flutter/flutter#180388)
2025-12-30 [email protected] Roll Skia from 27b587c4b160 to 4c438e0537fc (1 revision) (flutter/flutter#180384)
2025-12-30 [email protected] Roll Fuchsia Linux SDK from DdllqZRZYriOd7Q8v... to t1eBl_kzKGV5K28OU... (flutter/flutter#180378)
2025-12-30 [email protected] Roll Skia from 11690456a90d to 27b587c4b160 (1 revision) (flutter/flutter#180377)
2025-12-30 [email protected] Allow setting vector uniforms by name. (flutter/flutter#179927)
2025-12-30 [email protected] Roll Skia from 7abf754bce14 to 11690456a90d (6 revisions) (flutter/flutter#180374)
2025-12-29 [email protected] Add support for Shift-Delete, Ctrl-Insert and Shift-Insert (flutter/flutter#178561)
2025-12-29 [email protected] Roll Skia from c85d3e2b12d7 to 7abf754bce14 (1 revision) (flutter/flutter#180371)
2025-12-29 [email protected] Roll Packages from 2164da9 to b3c3ca8 (2 revisions) (flutter/flutter#180365)
2025-12-29 [email protected] Roll Skia from c29a475066f5 to c85d3e2b12d7 (1 revision) (flutter/flutter#180363)

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] 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

...
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

framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants