textfield_tags
textfield_tags copied to clipboard
Add custom data type support
Getting 'Instance of 'MasterData'
when I use AutComplete<MasterData>
. see code below
optionsBuilder: (TextEditingValue textEditingValue) {
if (textEditingValue.text == '') {
return const Iterable<MasterData>.empty();
}
return addNewProjectsProvider.serviceList.where((MasterData option) {
return option.typeName!.contains(textEditingValue.text.toLowerCase());
});
},
After selecting any item, it shows name properly.
So, is there any way to change 'Instance of 'MasterData' to actual type(MasterData.typeName
) ?
This has nothing to do with this package. This is happening because your object MasterData doesn't return a text object which is needed to be displayed by Autocompleter widget.
Our widget actually supports this now. But note AutComplete is not our widget