DEV Community

furball
furball

Posted on

[Help] Flutter Dropdown

Hi All. This is my first time posting here, so pardon if this looks very messy. Below is my issue.

I want the the box dynamically fit the picked value, so it can grows bigger and smaller to fit its content.

Here is the box I mentioned:

The container box

The list of values:

The value list

How it looks like when each value picked:

short

medium

long


Here is my code for review.

Is it possible with my code structure right now?

Please give me direction on what should I do to make it work (change widget is ok) or pointing me out where I did wrong.

Thanks a lot!

Top comments (2)

Collapse
 
yoyoyokz profile image
AbdoulK • Edited

hello i think there is no issue but you have to know what's the purpose of making dropdowns its for short text not long !!! and because people do not want to waste time reading lot of text (user experience purpose).

Also i quickly saw your code and 'overflow: TextOverflow.visible," in line 79 tell us "If the text is out of borders make it visible" so you should look for the opposite like "overflow:hidden;" in html and css

Good luck

Collapse
 
selly profile image
furball

hm i see, i got your point, we got to see the full text in the list before selecting anyway. thanks for responding my question :)