Comments (3)
Hello ihorkozar,
That's right. If you don't set buttonWidth or dropdownWidth, then the width of the button & menu is taken as the maximum width of the child element from the list or the hint text.
The padding that your dropdownlist has is the itemPadding
which by default is _kMenuItemPadding = EdgeInsets.symmetric(horizontal: 16.0)
if you didn't use the itemPadding
parameter.
To make your dropdownlist's width dynamic and your elements fit into the dropdown, use itemPadding: EdgeInsets.zero
.
In this case, To add padding to your elements wrap your Text
widget that you pass to items
parameter with padding. I think this will solve your issue.
from dropdown_button2.
@AhmedLSayed9 Thanks, your advice helped a lot.
It may be worth passing these additional indents immediately in the library, this would be a good default solution.
from dropdown_button2.
The problem is if we add padding to the width immediately in the library, then static width won't be accurate. I'll try to find if we could make it work without changing static width
from dropdown_button2.
Related Issues (20)
- The menus need to be fully displayed, and after selection, the overflow needs to be replaced with ellipsis (...).
- Horizontal line issue under DropdownButtonFormField2 HOT 1
- Example 4 | Multi Select Dropdown HOT 1
- searchData not working in release app (show grey blank dropdown container) this code HOT 1
- Failed assertion: line 991 pos 11 ... There shoiuld be exactly one item with DropdownButtons ...
- somehow i delet class of DropdownButton2 class ,i dont know how to ReCreate or ReAdd it please Share me Solution @AhmedLSayed HOT 1
- Disable dropdown button HOT 1
- button have a shadow
- Using DropdownButton2 above the Navigator
- update selected value when menu is closed.
- Why can't find dropdownSeparator
- Can't change thumb color
- Conflicting paddings in MenuItemStyleData, DropDownStyleData, and ButtonStyleData HOT 11
- Can't open dialog on menu item tap HOT 1
- overlayColor has no effect HOT 6
- Searching item.child not working on release mode but in debug mode run successfully. HOT 1
- `DropdownButtonFormField2` doesn't hide its underline. HOT 1
- How to set MouseCursor
- When the window size changes, the pop-up layer position is incorrect HOT 5
- DropDown button 2 latest beta fails with empty dropdown HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dropdown_button2.