scribbleFocusElement method Null safety

Future<void> scribbleFocusElement(
  1. String elementIdentifier,
  2. Offset offset
)

Simulates a Scribble focus.

Implementation

Future<void> scribbleFocusElement(String elementIdentifier, Offset offset) async {
  assert(isRegistered);
  await TestDefaultBinaryMessengerBinding.instance!.defaultBinaryMessenger.handlePlatformMessage(
    SystemChannels.textInput.name,
    SystemChannels.textInput.codec.encodeMethodCall(
      MethodCall(
        'TextInputClient.focusElement',
         <dynamic>[elementIdentifier, offset.dx, offset.dy]
      ),
    ),
    (ByteData? data) { /* response from framework is discarded */ },
  );
}