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;
    // We call super.value to avoid finding completions.
    super.value = TextEditingValue(
      text: replacement,
      selection: TextSelection.collapsed(offset: replacement.length),
    );
  }
}