doubleTapDownInParagraph method

Future<TestGesture> doubleTapDownInParagraph(
  1. String nodeId,
  2. int offset, {
  3. TextAffinity affinity = TextAffinity.downstream,
  4. Finder? superEditorFinder,
})

Implementation

Future<TestGesture> doubleTapDownInParagraph(
  String nodeId,
  int offset, {
  TextAffinity affinity = TextAffinity.downstream,
  Finder? superEditorFinder,
}) async {
  // Calculate the global tap position based on the TextLayout and desired TextPosition.
  final globalTapOffset = _findGlobalOffsetForTextPosition(nodeId, offset, affinity, superEditorFinder);

  final gesture = await startGesture(globalTapOffset);
  await gesture.up();
  await pump(kTapMinTime + const Duration(milliseconds: 1));

  await gesture.down(globalTapOffset);
  await pump(kTapMinTime + const Duration(milliseconds: 1));
  await pump();

  return gesture;
}