Home > database >  I am having problem running multi_select_flutter widget properly in flutter
I am having problem running multi_select_flutter widget properly in flutter

Time:11-27

hi I am trying multi_select_flutter but was unable to solve this error

A value of type 'List<Object?>' can't be assigned to a variable of type 'List'.

this is my code of multi_select_flutter widget i am using

MultiSelectBottomSheetField(
                  initialChildSize: 0.4,
                  listType: MultiSelectListType.CHIP,
                  searchable: true,
                  buttonText: Text("Favorite Animals"),
                  title: Text("Animals"),
                  items: _items,
                  onConfirm: (values) {
                    // _selectedAnimals2 = values;
                  },
                  chipDisplay: MultiSelectChipDisplay(
                    onTap: (value) {
                      setState(() {
                        _selectedAnimals2.remove(value);
                      });
                    },
                  ),
                ),

CodePudding user response:

_items's element should be non-nullable, because items decalaration like: enter image description here

type not matched is the reason you encounter the error.

CodePudding user response:

enter image description here

Its already there but still it shows same error

  • Related