longPressInParagraph method

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

Simulates a long-press at the given text offset within the paragraph with the given nodeId.

Implementation

Future<void> longPressInParagraph(
  String nodeId,
  int offset, {
  TextAffinity affinity = TextAffinity.downstream,
  Finder? superEditorFinder,
}) async {
  final gesture = await tapDownInParagraph(nodeId, offset, affinity: affinity, superEditorFinder: superEditorFinder);
  await pump(kLongPressTimeout + kPressTimeout);

  await gesture.up();
  await pump();
}