enterTextByTooltip method

Future<Response> enterTextByTooltip(
  1. String text,
  2. String tooltip
)

Implementation

Future<Response> enterTextByTooltip(String text, String tooltip) async {
  VM vm = await vmService.getVM();
  IsolateRef? mainIsolate = vm.isolates!.first;

  // First tap the widget
  await vmService.callServiceExtension(
    'ext.flutter.driver',
    isolateId: mainIsolate.id!,
    args: {
      'command': 'tap',
      'finderType': 'ByTooltip',
      'tooltip': tooltip,
    },
  );

  // Then enter text
  return await vmService.callServiceExtension(
    'ext.flutter.driver',
    isolateId: mainIsolate.id!,
    args: {
      'command': 'enter_text',
      'text': text,
    },
  );
}