Open singgihmardianto opened 2 months ago
@singgihmardianto please were you able to solve this issue?
class InputMultiSelect
final List
@override
State
class _InputMultiSelectState
@override void initState() { super.initState(); }
@override
void didUpdateWidget(InputMultiSelect
if (!listEquals(oldWidget.items, widget.items)) { controller.setItems(widget.items! .map((item) => DropdownItem( label: item.toString(), value: item, selected: widget.selectedItem!.contains(item))) .toList()); } }
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.fromLTRB(0, 0, 12, 12),
child: SizedBox.fromSize(
size: const Size.fromHeight(39),
child: MultiDropdown
On Tue, Nov 19, 2024 at 3:24 PM Kehinde Alabi @.***> wrote:
@singgihmardianto https://github.com/singgihmardianto please were you able to solve this issue?
— Reply to this email directly, view it on GitHub https://github.com/oi-narendra/multiselect-dropdown/issues/156#issuecomment-2484679541, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEF7OWXGNJTJ2OR465S2JN32BK4P3AVCNFSM6AAAAABOGPADMKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOBUGY3TSNJUGE . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Hi there, great plugin here! Basically, so thankful with this plugin. But I am facing an issue when I updating the items parameters.
First, I have a component called
InputMultiselect
that wrap this widget. Something like thisThen I will use in it my form simply just like this:
The problem is whenever I update
_categoryOptions
usingsetState()
the dropdown will not update the items. I already do a trace to look how the plugin works, so may be I can get a hot fix for my issue.I debug
widget.items
on line 383 the items is updated.But here on line 433, it's uses
_dropdownController.items
instead ofwidget.items
There I assume may be the reason why the dropdown it's not updating.
Any idea how to do a hot fix here? Or Am I missed something? Thanks!