updateEditingValueWithDeltas method Null safety

void updateEditingValueWithDeltas(
  1. List<TextEditingDelta> textEditingDeltas
)

Requests that this client update its editing state by applying the deltas received from the engine.

The list of TextEditingDelta's are treated as changes that will be applied to the client's editing state. A change is any mutation to the raw text value, or any updates to the selection and/or composing region.

This example shows what an implementation of this method could look like.
TextEditingValue? _localValue;
@override
void updateEditingValueWithDeltas(List<TextEditingDelta> textEditingDeltas) {
  if (_localValue == null) {
    return;
  }
  TextEditingValue newValue = _localValue!;
  for (final TextEditingDelta delta in textEditingDeltas) {
    newValue = delta.apply(newValue);
  }
  _localValue = newValue;
}

Implementation

void updateEditingValueWithDeltas(List<TextEditingDelta> textEditingDeltas);