[DRAFT] Fix DropdownButtonFormField icon alignment when label text is provided#159328
[DRAFT] Fix DropdownButtonFormField icon alignment when label text is provided#159328TahaTesser wants to merge 3 commits intoflutter:masterfrom TahaTesser:fix_dropdown_form_field_icons
DropdownButtonFormField icon alignment when label text is provided#159328Conversation
DropdownButtonFormField icon alignment, color, and size issuesDropdownButtonFormField icon alignment, color, and size issues
|
Blocked by #159431 |
DropdownButtonFormField icon alignment, color, and size issuesDropdownButtonFormField icon alignment when label text is provided
|
There are Google failures, but they seem to be all intended movement of the icon position. I will try to look through all of them tomorrow. |
justinmc
left a comment
There was a problem hiding this comment.
Most Google test failures are intended movement of the dropdown icon, but there are a handful that caused a layout overflow error. A bunch of others had the content of the field truncated by a few extra characters. It does seem like there is effectively less horizontal space available for the text in the field now after the change, which is weird, because the icon seems to have moved horizontally towards the edge of the field, which visually looks like it should give more space!
Any idea why that might have happened? Is it the suffixIconConstraints thing?
Also to confirm, in most cases the icon should have moved both up vertically and towards the edge horizontally, right?
| testWidgets('Form is entirely visible and rejects invalid responses', (WidgetTester tester) async { | ||
| await tester.pumpWidget(const example.AutocompleteExampleApp()); | ||
| expect(find.text('RawAutocomplete Form'), findsOneWidget); | ||
| // One of the icon is hidden for an input decoration height workaround |
| child: widget.icon ?? defaultIcon, | ||
| // TODO(TahaTessser): Remove InputDecorator height workaround | ||
| // for https://github.com/flutter/flutter/issues/159431. | ||
| // Hiding the icon with maintainSize does not effect the baseline. |
The could be the hidden row icon with maintain size which we've as a workaround. If we remove It conditionally when the dropdownbutton is a form field, we run into a blocker #159431. From your description of the internal failures it looks like this is not good enough to avoid other issues. Thanks for taking look @justinmc |
DropdownButtonFormField icon alignment when label text is providedDropdownButtonFormField icon alignment when label text is provided
Fix DropdownButtonFormField arrow icon is misaligned vertically
Code sample
expand to view the code sample
Before
After
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.