setEditPreedit method

Future<EditState> setEditPreedit(
  1. String text, {
  2. int cursor = 0,
  3. bool commit = false,
  4. Int64? sessionId,
  5. Int64? stateVersion,
})

Update IME preedit/composition state for the active edit session.

Implementation

Future<EditState> setEditPreedit(
  String text, {
  int cursor = 0,
  bool commit = false,
  Int64? sessionId,
  Int64? stateVersion,
}) async {
  final session = await _prepareSessionCommand(
    EditorSessionCommand()
      ..preeditChanged = (EditorPreeditChanged()
        ..text = text
        ..cursor = cursor
        ..commit = commit),
    sessionId: sessionId,
    stateVersion: stateVersion,
  );
  final state = await VolvoxGridService.Edit(EditCommand()
    ..gridId = _gridId
    ..session = session);
  notifyListeners();
  return state;
}