commitIfComposing method

void commitIfComposing()

Commits any active preedit into the document. Safe to call even when no composition is active. Used on focus loss, connection close, enter key, send/done actions, etc.

Implementation

void commitIfComposing() {
  if (_isComposing && _preeditText.isNotEmpty) {
    _commitPreedit(_preeditText);
  } else if (_isComposing) {
    _cancelPreedit();
  }
}