Skip to content

Fix DropdownButtonFormField underline alignment at bottom - #181040

Closed
Mairramer wants to merge 18 commits into
flutter:masterfrom
Mairramer:fix/dropdownformfield-underline-bottom
Closed

Mairramer wants to merge 18 commits into
flutter:masterfrom
Mairramer:fix/dropdownformfield-underline-bottom

Conversation

@Mairramer

Copy link
Copy Markdown
Contributor

This PR fixes the visual issue where the underline of a DropdownButtonFormField did not align at the bottom of its expanded container.

Fixes #162350

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

@github-actions github-actions Bot added framework flutter/packages/flutter repository. See also f: labels. p: material_ui material_ui package in flutter/packages labels Jan 15, 2026

@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 addresses a visual bug in DropdownButtonFormField where the underline did not align to the bottom when the widget was expanded vertically. The fix correctly utilizes the expands property of the InputDecorator by passing the isExpanded value to it. This ensures the decorator, and thus its underline, expands to fill the available vertical space. A new widget test has been added to verify this behavior, confirming the fix. The changes are logical and well-implemented. My only suggestion is to update the documentation for the isExpanded property to reflect its new role in vertical expansion, which I've detailed in a specific comment.

Comment thread packages/flutter/lib/src/material/dropdown.dart Outdated
@Mairramer
Mairramer marked this pull request as draft January 15, 2026 18:12
@flutter-dashboard

Copy link
Copy Markdown

This pull request has been changed to a draft. The currently pending flutter-gold status will not be able to resolve until a new commit is pushed or the change is marked ready for review again.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@Mairramer
Mairramer marked this pull request as ready for review January 16, 2026 14:50

@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 correctly fixes an alignment issue with the DropdownButtonFormField's underline when isExpanded is true. The fix involves passing the isExpanded property to the underlying InputDecorator, which correctly makes it expand to fill its container's height. The documentation for isExpanded has also been helpfully updated to reflect this behavior, and a new regression test has been added to verify the fix. The changes are well-implemented and look good.

@dkwingsmt
dkwingsmt requested a review from QuncCccccc January 21, 2026 19:14
Comment thread packages/flutter/lib/src/material/dropdown.dart Outdated
@Mairramer
Mairramer requested a review from QuncCccccc January 31, 2026 14:29
@Mairramer
Mairramer force-pushed the fix/dropdownformfield-underline-bottom branch from 50c1724 to 76084ba Compare February 3, 2026 20:51
Comment thread packages/flutter/lib/src/material/dropdown.dart Outdated
@Mairramer
Mairramer force-pushed the fix/dropdownformfield-underline-bottom branch 2 times, most recently from 3bee679 to c620da1 Compare February 23, 2026 16:37
Comment thread packages/flutter/lib/src/material/dropdown.dart Outdated
Comment thread packages/flutter/test/material/dropdown_test.dart Outdated
Comment thread packages/flutter/lib/src/material/dropdown.dart Outdated
@Mairramer
Mairramer force-pushed the fix/dropdownformfield-underline-bottom branch from 241b952 to 2d867ed Compare February 26, 2026 21:41
@Mairramer
Mairramer requested a review from QuncCccccc February 26, 2026 23:17

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

Sorry for the late response. I'll make sure we made progress this week:)

Comment thread packages/flutter/lib/src/material/dropdown.dart Outdated

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

Overall looks good to me! Just left some comments.

Comment thread packages/flutter/lib/src/material/dropdown.dart Outdated
Comment thread packages/flutter/lib/src/material/dropdown.dart Outdated
Comment thread packages/flutter/lib/src/material/dropdown.dart Outdated
Comment thread packages/flutter/test/material/dropdown_form_field_test.dart Outdated

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

@QuncCccccc QuncCccccc added autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD labels Apr 8, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Apr 8, 2026
@auto-submit

auto-submit Bot commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/181040, because This PR has not met approval requirements for merging. The PR author is not a member of flutter-hackers and needs 1 more review(s) in order to merge this PR.

  • Merge guidelines: A PR needs at least one approved review if the author is already part of flutter-hackers or two member reviews if the author is not a member of flutter-hackers before re-applying the autosubmit label. Reviewers: If you left a comment approving, please use the "approve" review action instead.

@auto-submit

auto-submit Bot commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/181040, because - The status or check suite ci.yaml validation has failed. Please fix the issues identified (or deflake) before re-applying this label.

@github-actions github-actions Bot removed the CICD Run CI/CD label Apr 15, 2026
@dkwingsmt dkwingsmt added the CICD Run CI/CD label Apr 15, 2026
@github-actions github-actions Bot removed the CICD Run CI/CD label Apr 22, 2026
@dkwingsmt

Copy link
Copy Markdown
Contributor

Status: g3fix has been approved, and Google Testing has passed with the g3fix. I'm deflaking the other presubmit checks. Once everything is green, we can mark this PR as complete and archive it for unfreezing.

@dkwingsmt dkwingsmt added the CICD Run CI/CD label Apr 22, 2026
@QuncCccccc

Copy link
Copy Markdown
Contributor

Seems we need a roller to approve the CL to pass google testing.

Screenshot 2026-04-22 at 5 10 33 PM

@dkwingsmt

Copy link
Copy Markdown
Contributor

It's ok. The Google test has passed at least once, indicating that this is probably ok. I'll mark that this PR has reached completion.

At the moment we're not able to merge this PR for the moment due to the Material/Cupertino code freeze (#184093). As soon as the decoupling is complete, we will post a way to port this PR to the new packages to land. In the meantime, I'll convert this PR to a draft and apply a label so that we can quickly find it when the freeze is lifted.

Thanks for your contribution!

@dkwingsmt
dkwingsmt marked this pull request as draft April 24, 2026 22:40
@dkwingsmt dkwingsmt added the waiting for code freeze This PR is waiting for a code freeze to resolve. label Apr 24, 2026
@Piinks Piinks added the Decoupling: Not ready to port yet Instructions will be provided when this is ready to move to flutter/packages. label Jun 24, 2026
@Piinks

Piinks commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

I've marked this PR as not ready to port to flutter/packages yet.
We'll provide instructions to move this change over to material_ui/cupertino_ui once ready to receive PRs. Thank you!

@Piinks

Piinks commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

material_ui and cupertino_ui are now accepting contributions. :)

This PR can be ported over to flutter/packages!

Guidance and instructions for easily porting over can be found in #188444

@Piinks Piinks added Decoupling: Port to flutter/packages This PR is ready to be ported to flutter/packages. We will provide instructions to do so. and removed Decoupling: Not ready to port yet Instructions will be provided when this is ready to move to flutter/packages. labels Aug 18, 2026
@Mairramer

Copy link
Copy Markdown
Contributor Author

@QuncCccccc @dkwingsmt Ported to flutter/packages#12551.

@Mairramer Mairramer closed this Aug 22, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Oct 2, 2026
…om (#12606)

This PR fixes the visual issue where the underline of a `DropdownButtonFormField` did not align at the bottom of its expanded container.

Fixes flutter/flutter#162350

Port of flutter/flutter#181040.

## Pre-Review Checklist

**Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). 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.

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

Labels

Decoupling: Port to flutter/packages This PR is ready to be ported to flutter/packages. We will provide instructions to do so. framework flutter/packages/flutter repository. See also f: labels. p: material_ui material_ui package in flutter/packages waiting for code freeze This PR is waiting for a code freeze to resolve. will affect goldens Changes to golden files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DropdownButtonFormField does not scale correctly to fit its parent's height

5 participants