Skip to content

[material_ui] SearchAnchor overlay expands to full screen when viewport size changes - #12466

Merged
auto-submit[bot] merged 7 commits into
flutter:mainfrom
elliette:migrate-pr-186537-4
Aug 20, 2026
Merged

auto-submit[bot] merged 7 commits into
flutter:mainfrom
elliette:migrate-pr-186537-4

Conversation

@elliette

@elliette elliette commented Aug 13, 2026 •

Copy link
Copy Markdown
Member

Port over flutter/flutter#186537 from flutter/flutter.

Fixes flutter/flutter#186154

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2

@elliette elliette added the CICD Run CI/CD label Aug 13, 2026
@github-actions github-actions Bot added triage-framework Should be looked at in framework triage p: material_ui labels Aug 13, 2026
@elliette
elliette marked this pull request as ready for review August 13, 2026 20:56

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

Copy link
Copy Markdown
Contributor

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 wraps the SearchAnchor view content in a LayoutBuilder to dynamically adjust its constraints based on the parent container, enabling the full-screen view to resize on viewport changes such as device rotation. The review feedback suggests setting minWidth and minHeight to 0.0 when showFullScreenView is true to prevent potential overflow issues when parent constraints are smaller than the minimum dimensions.

Comment on lines +1148 to +1157
constraints: BoxConstraints(
minWidth: minWidth,
maxWidth: widget.showFullScreenView
? math.max(constraints.maxWidth, minWidth)
: _viewRect.width,
minHeight: minHeight,
maxHeight: widget.showFullScreenView
? math.max(constraints.maxHeight, minHeight)
: _viewRect.height,
),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

When widget.showFullScreenView is true, the search view is intended to be full screen. If the parent constraints are smaller than minWidth or minHeight (e.g., on very small screens or inside a small nested Navigator), forcing the constraints to minWidth/minHeight via math.max will cause the full-screen view to overflow its parent boundaries.

Instead of forcing the maximum constraints to be at least minWidth/minHeight, we can set the minWidth/minHeight to 0.0 when widget.showFullScreenView is true. This allows the full-screen view to scale down and fit perfectly within the parent constraints without overflowing or throwing assertion errors.

              constraints: BoxConstraints(
                minWidth: widget.showFullScreenView ? 0.0 : minWidth,
                maxWidth: widget.showFullScreenView
                    ? constraints.maxWidth
                    : _viewRect.width,
                minHeight: widget.showFullScreenView ? 0.0 : minHeight,
                maxHeight: widget.showFullScreenView
                    ? constraints.maxHeight
                    : _viewRect.height,
              ),

@Piinks Piinks added triage-design Should be looked at in design triage and removed triage-framework Should be looked at in framework triage labels Aug 17, 2026
@dkwingsmt
dkwingsmt requested a review from QuncCccccc August 19, 2026 18:36

@QuncCccccc QuncCccccc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Thanks!

@elliette elliette added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 20, 2026
@auto-submit
auto-submit Bot merged commit be0a4e0 into flutter:main Aug 20, 2026
13 checks passed
pull Bot pushed a commit to ScorpiusDraconis83/flutter that referenced this pull request Aug 21, 2026
…r#191480)

flutter/packages@1785501...252bb33

2026-08-20 pateltirth454@gmail.com [material_ui] A typo in the README
file of the package. (flutter/packages#12526)
2026-08-20 jmccandless@google.com [material_ui] Animated theme test from
flutter/flutter (flutter/packages#12487)
2026-08-20 fluttergithubbot@gmail.com Sync release-material_ui-1.0.1 to
main (flutter/packages#12513)
2026-08-20 pateltirth454@gmail.com [material_ui] [cupertino_ui] Add
missing Widget of the Week videos to widget API docs
(flutter/packages#12468)
2026-08-20 43054281+camsim99@users.noreply.github.com
[camera_android_camerax] Add agentic guidance for adding native unit
tests (flutter/packages#12369)
2026-08-20 21270878+elliette@users.noreply.github.com [material_ui]
SearchAnchor overlay expands to full screen when viewport size changes
(flutter/packages#12466)

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-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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD p: material_ui triage-design Should be looked at in design triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Search View doesn't update size on navigator resize

3 participants