joo6077 / cool_dropdown

MIT License
18 stars 18 forks source link

Dropdown full width #1

Closed rsboarder closed 3 years ago

rsboarder commented 3 years ago

Hey! Big thx for this package, it's really very customizable but I need more :)

Is it possible to make dropdowns width based on result width?

Current situation is: image And what I want to achieve: image

joo6077 commented 3 years ago

Thank you for using my packages! I took your problems and I implemented some code to fix your problems. You should update the cool dropdown to 1.4.0 and check onOpen and I set the dropdownWidth default value as resultWidth.

rsboarder commented 3 years ago

@joo6077 onOpen works like a charm, thx! But if resultWidth: double.maxFinite, then dropdown doesn't appear.

joo6077 commented 3 years ago

@rsboarder Hm.. I think you want to fit the resultbox as your screen width. I think the problem is double.maxFinite pass value to dropdownWidth as like 1.79808...+e something like this. When I tested MediaQuery.of(context).size.width this worked well on dropdownWidth too(fit to screen width). I would like to recommend you to use MediaQuery one! Do you have any special reasons?

rsboarder commented 3 years ago

@joo6077 yes, sry, I'm a newbie in flutter. Decided to wrap widget in LayoutBuilder and to pass constraints.maxWidth