setSelected method

void setSelected(
  1. String? selected
)

Implementation

void setSelected(String? selected) {
  setState(() {
    this.selectedText = selected;
    formState?.didChange(selected);
  });

  if (widget.onSelect != null) {
    var key = _itens
            .where((item) => item.presentation == this.selectedText)
            .first
            .value ??
        null;

    widget.onSelect!(key);
  }
}