CHB61 / multi_select_flutter

A flexible multi select package for Flutter. Make multi select widgets the way you want.
https://pub.dev/packages/multi_select_flutter
BSD 2-Clause "Simplified" License
238 stars 223 forks source link

InitialValue does not work using partial array items #176

Closed muricardoso closed 1 year ago

muricardoso commented 1 year ago

Im use initialState because return data with database, but not show partial values only all value example: static List _animals = [ // ALL VALUES Animal(id: 1, name: "Lion"), Animal(id: 2, name: "Flamingo"), Animal(id: 3, name: "Hippo"), Animal(id: 4, name: "Horse"), Animal(id: 5, name: "Tiger"), Animal(id: 6, name: "Penguin"), Animal(id: 7, name: "Spider"),

]; static List _partialValues = [ //PARTIALS VALUES Animal(id: 1, name: "Lion"), Animal(id: 2, name: "Flamingo"), ];

@override void initState() { _selectedAnimals5 =_partialValues;// this not Working only working _selectedAnimals5 = _animals;/ beacause this all items using in widget super.initState(); }`

muricardoso commented 1 year ago

So sorry, mi data response of api, and owns instance

muricardoso commented 1 year ago

I resolve this problem comparing arrays and return all values filtred