complete method

void complete()

Completes the current typeahead suggestion by replacing the text with the replacement.

Implementation

void complete() {
  if (current case (completion: final _, :final replacement)) {
    current = null;
    rawValue = TextEditingValue(
      text: replacement,
      selection: .collapsed(offset: replacement.length),
    );
  }
}