AhmedLSayed9 / dropdown_button2

Flutter's core Dropdown Button widget with steady dropdown menu and many other features.
https://pub.dev/packages/dropdown_button2
MIT License
264 stars 122 forks source link

Feature to display dropdown menu only below dropdown button #278

Closed hlvs-apps closed 3 months ago

hlvs-apps commented 3 months ago

Hi, I added the option dropdownOnlyBelowButton to DropdownButton2, which when enabled forces the menu to be displayed only below the DropdownButton2. I also added documentation to README.md and dartdoc.

During development, I noticed that not resetting the search text controller before reopening the menu, disturbs the correct scroll position calculation, which can lead to a blank menu. This bug is fixed with this pull request. In the last commit, I inserted a Material-Widget surrounding the menu contents but not the search bar, which leads to ink animations not to be displayed over the search Widget; which was not the case before.

It might have been smarter to separate this pull request into several ones to address only one feature/issue at once, but I can't delete them now. Anyway, it would be nice if you could take a look at this,

Kind Regards

Henri Sauer

AhmedLSayed9 commented 3 months ago

What's the need for displaying menu only below dropdown button?

Also, we surely need to separate this into 2 PRs for the ease of rollback.

hlvs-apps commented 3 months ago

I'm developing a font chooser menu, and don't want the chosen font displayed in the drop-down button to be hidden so the user can compare the current selected font with the other ones.

hlvs-apps commented 3 months ago

Seperated in 2 PRs

hlvs-apps commented 3 months ago

Any further thoughts on this yet?