detach method
Close the session and clear any visible preedit. Safe to call when not
attached.
notify — when false, skip onPreeditChanged (e.g. widget dispose).
Implementation
void detach({bool notify = true}) {
_composing = false;
if (notify) onPreeditChanged(null);
_conn?.close();
_conn = null;
}