Closed mrizkynurfajrie closed 3 months ago
you can init your items with selected
attribute, like DropdownItem(label: value: selected:true)
you can init your items with
selected
attribute, likeDropdownItem(label: value: selected:true)
Oh okay, i got it. Thank you mate
Hi there,
I found that mutating the parameter selected
is not mutating the view respectfully.
Let's say I have this:
options = ['Foo', 'Bar']
selected = ['Foo']
then with a button I reset the selected so the value become []
, the code run ok, no error, but the field is not cleared.
The full snippet here:
Padding(
padding: EdgeInsets.fromLTRB(0, 0, 12, 12),
child: SizedBox.fromSize(
size: Size.fromHeight(39),
child: MultiDropdown<T>(
items: items!
.map((item) => DropdownItem(
label: item.toString(),
value: item,
selected: selectedItem!.contains(item)))
.toList(),
)
)
);
Am I missed something? Thanks!
Hi, Congratulations for your excellent works after release new stable version of this package a few days ago.
I little bit confused with this update. Before this update (on 2.1.4 ver.) to initiate selected items/options we can use .setSelectedOptions on controller. But in this update i can't see that function anymore. I can't find migration documentation for this feature/function. Is it replaced with new parameter just like setOptions to setItems, or you just remove it?