setSelectedById method

void setSelectedById(
  1. dynamic id
)

Implementation

void setSelectedById(dynamic id) async {
  List<SearchFieldSource> result = await widget.getSource();

  if (result != null) {
    var selection = result.where((w) => w.value == id)?.first ?? null;

    if (selection != null) {
      resolveSelectedValue(selection);
    }
  }
}