controller not working properly
controller.setItems() controller.selectWhere() controller.selectIndex()
i aim is to fetch select items from database store earlier ...
so i am using this methods but these are not working
error i get during controller.setItem() is: The following assertion was thrown while dispatching notifications for MultiSelectController<MyModelClass>: Assertion failed: file:///C:/Softwares/Flutter/flutter/packages/flutter/lib/src/widgets/overlay.dart:1582:12 SchedulerBinding.instance.schedulerPhase != SchedulerPhase.persistentCallbacks is not true MultiSelectController<MyModelClass> sending notification was: MultiSelectController(options: [ValueItem(label: hero, value: Instance of 'MyModelClass', disabled: false, selected: true), ValueItem(label: employee, value: Instance of 'MyModelClass', disabled: false, selected: true)], open: false)
and in case of controller.selectWhere() and controller.selectIndex().... Nothing happens no error no nothing
I found the: you need to mark the respective item in the items attribute under the MultiDropdown as true. For example:
MultiDropdown<T>(
items: items!
.map((item) => DropdownItem(
label: item.toString(),
value: item,
selected: selected!.contains(item.toList(),
)
The following functions are not working because in items attribute under the MultiDropdown, the item.selected gets overridden:
controller.selectWhere()
controller.selectIndex()
controller.select()