tap method

Future<void> tap(
  1. dynamic target, {
  2. bool pumpFrames = true,
  3. bool warnIfMissed = true,
  4. Screenshot? screenshot,
})

Implementation

Future<void> tap(
  dynamic target, {
  bool pumpFrames = true,
  bool warnIfMissed = true,
  Screenshot? screenshot,
}) async {
  var finder = targetToFinder(target);

  var box = _getElementBox(finder);
  if (box != null) {
    tester.runContext.previousTap ??=
        box.localToGlobal(box.size.topLeft(Offset.zero)) & box.size;
  }

  await tester.tap(finder, warnIfMissed: warnIfMissed);
  await _pumpFramesIfNeeded(pumpFrames);
  await _screenshotIfNeeded(screenshot);
}