hiddencaliber / flutter_multiselect

Flutter package for multi-select UI widget
Other
52 stars 37 forks source link

Dynamic List #14

Open blendosantos opened 5 years ago

blendosantos commented 5 years ago

It would be nice to implement to accept an entity list and not an / json array.

I can't use a dynamic list.

hiddencaliber commented 5 years ago

@blendosantos : I will try to add this feature in next release. Thanks for the feedback.

amila4d commented 4 years ago

This is good and need to apply dynamic list. I am unable to apply dynamic object list for this

amila4d commented 4 years ago

I have added dynamic list to this and now I can not get pick event.

final dropdownCategories = FutureBuilder<List>( future: appDatabase.categoryDao.findAllCategories(), builder: (BuildContext context, AsyncSnapshot<List> snapshot) { if(snapshot != null && snapshot.data.length > 0 ) { return MultiSelect( autovalidate: false, titleText: "Pick category", validator: (value) { if (value == null) { return 'Please select one or more option(s)'; } }, errorText: 'Please select one or more option(s)', dataSource: snapshot.data.map((e) => e.toJson()).toList(), textField: 'name', valueField: 'id', filterable: true, required: true, value: null, onSaved: (value) { print('The value is $value'); } ); } });