updateEditingValue method Null safety

void updateEditingValue(
  1. TextEditingValue value
)

Simulates the user changing the TextEditingValue to the given value.

Implementation

void updateEditingValue(TextEditingValue value) {
  assert(isRegistered);
  // Not using the `expect` function because in the case of a FlutterDriver
  // test this code does not run in a package:test test zone.
  if (_client == 0)
    throw TestFailure('Tried to use TestTextInput with no keyboard attached. You must use WidgetTester.showKeyboard() first.');
  _binaryMessenger.handlePlatformMessage(
    SystemChannels.textInput.name,
    SystemChannels.textInput.codec.encodeMethodCall(
      MethodCall(
        'TextInputClient.updateEditingState',
        <dynamic>[_client, value.toJSON()],
      ),
    ),
    (ByteData? data) { /* response from framework is discarded */ },
  );
}