resolveSelectedValue method
Implementation
void resolveSelectedValue(List<SearchFieldSource> result) {
selectedResult = result;
setState(() {
widget.selectedValue = result;
});
String selectedString = "";
for (int i = 0; i < result.length; i++) {
var label = result[i].label;
if (i + 1 == result.length) {
selectedString += "$label";
} else {
selectedString += "$label, ";
}
}
_controller.text = selectedString;
if (widget.onSelect != null) widget.onSelect!(widget.selectedValue);
}