Fix battery chemistry dropdown layout overflow#162
Conversation
|
Looks good except the CI failure, also to save you time if you haven't already be sure to run dart format before committing your changes. |
|
first one didn't have the ^ arrow second does |
It got a bit messy, we shouldn't have any changes to the lock file. Do you know how to revert changes to the one file? |
|
So it's just the battery setting fix? |
|
I may need a little bit of guidance. Github has so many features I had no idea existed. |
1 similar comment
|
I may need a little bit of guidance. Github has so many features I had no idea existed. |
Ya you should be able to |
|
Done |
|
Awesome, thanks for the PR and congrats on your first! |
|
Thanks for standing by while I learn. Looking forward to doing many more across the matrix |


Fix Battery Settings Layout Overflow (Dropdown Causing Vertical Text Wrap)
Problem
The Battery Chemistry row in App Settings was rendering incorrectly on smaller screens and certain device widths.
Observed issues:
This occurred because the
DropdownButtonwas placed inside thetrailing:slot of aListTile, alongside:The
ListTilecould not satisfy layout constraints, so Flutter compressed the subtitle to near-zero width, forcing character-by-character wrapping.Root Cause
ListTile.trailingis width-constrained and intended for compact widgets (icons, switches, small controls).Placing a wide widget like
DropdownButtonintrailing:caused horizontal constraint pressure. Flutter resolved this by shrinking the subtitle first, leading to vertical text collapse.Solution
Restructured the layout as follows:
Keep
ListTileresponsible only for:Move the dropdown out of
ListTile.trailing.Render the dropdown as a full-width control beneath the tile.
Use
DropdownButtonFormFieldwith:isExpanded: trueInputDecorationThis ensures:
Implementation Changes
Before:
DropdownButtoninsideListTile.trailingAfter:
ListTilehandles text onlyDropdownButtonFormFieldrendered beneath itisExpanded: trueResult
Testing
Tested:
No layout regressions observed.
Rationale
This aligns with Flutter layout best practices:
ListTile.trailingshould only contain compact widgets.ListTile.This change prevents future constraint-related UI issues.