-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Fix DropdownButtonFormField padding when ButtonTheme.alignedDropdown is true #162810
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix DropdownButtonFormField padding when ButtonTheme.alignedDropdown is true #162810
Conversation
|
The solution is based on #125193. |
justinmc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
|
|
||
| final EdgeInsetsGeometry padding = | ||
| ButtonTheme.of(context).alignedDropdown ? _kAlignedButtonPadding : _kUnalignedButtonPadding; | ||
| ButtonTheme.of(context).alignedDropdown && widget._inputDecoration == null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So DropdownButtonFormField customizes the InputDecoration which makes this padding irrelevant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is based on #131183 (comment) and the corresponding PR, see #131183. I think it is the best option as removing the padding might break some DropdownButton usages.
|
There were Google test failures, but I've checked them and they're all expected. Adding the autosubmit label. |
|
In which version will this setting be released? |
Description
This PR fixes
DropdownButtonFormFieldcontent padding whenButtonTheme.alignedDropdownis true.Before:
An extra padding is added before the content when
alignedDropdownis true:After:
The content has the same position whether
alignedDropdownis true or false:Related Issue
Fixes #123783
Tests
Adds 1 test.