Closed lcuis closed 4 years ago
Hello @icemanbsi , I think I have finished this PR. I don't think I will add a "Select all"/"Deselect all" button now. Cheers, Louis.
Hello @icemanbsi ,
I fell I changed things a bit too much for a PR to make sense now. I hope you don't mind I closed it? I am happy to reopen it if you'd like though.
Cheers.
Hi @lcuis , sorry for a long time not responding on your PR. Yeah, that's really a lot of things, and I think i can merge this PR. Do you mind if I add you as a collaborator? so you can add more features to this widget freely.. :D
Hello @icemanbsi ,
Thank you very much for the merge and the contributor proposal!
This PR was against my master branch which changed significantly since the PR proposal. It contained many more changes than those listed in the description as this is a different plugin:
This has several consequences for the users:
This also has consequences for your repository:
I will try to correct the consequences for the users so that they are not affected and I will probably remove the automated testing, the CI and the CD. Please let me know if you have a different point of view.
yes, I'm very aware of it. since I haven't published any update on flutter pub, I think it should be ok. Your version is much more better than I am. So it should be a good point for the user to change to the newer one with so much more flexibility. that's why I approved the PR and merged it.
Ok, thanks, I am working on the next PR to correct things for your plugin publication.
Label and error returned by function as Widget:
Or as strings:
Possibility to set the keyboard type for searches as follows:
New
searchFn
lets the developer define the search function through which the list items are filtered. For example, the string typed by the user can be considered as keywords separated by spaces:Here is an example of result:
Multiple selection
Multiple selection is available through the
multipleSelection
parameter:This disables
onChanged
callback function. See below.There is a way to customize the display of the selected and unselected items through the
displayItemWhenMultiple
parameter function:The done button is displayed only when in multiple selection mode. It can be customized either by setting the String parameter
doneText
or by setting the function parameterdoneButtonFn
:Or:
The multiple items set by default can be set through the parameter
selectedItems
as follows:Where the int values are the indexes of the selected items in the list of items.
Once the selection is done, the
selectedItems
list above is updated or the values can be retrieved through theonChangedMultiple
function parameter:The indexes of the selected items are sent to this callback function. Note that in the multiple selection case, the
onChanged
callback function is not called as the parameter type is not a list.The
validator
function can also be used in the multiple selection case:The
selectedValueWidgetFn
function can be used in the mutiple selection case the same way it is used in the single selection case:The clear button works the same way in multiple and single cases.
Ran:
As suggested here: https://pub.dev/packages/searchable_dropdown#-analysis-tab-
Improved package description as suggested here: https://pub.dev/packages/searchable_dropdown#-analysis-tab- Increased version from 1.1.0 to 1.1.1
Added to the README.md file:
DropdownMenuItem
objects must be strings or implement thetoString()
method.