tapAtDocumentPosition method

Future<void> tapAtDocumentPosition(
  1. DocumentPosition position, [
  2. Finder? superReaderFinder
])

Taps at the center of the content at the given position within a SuperReader.

Implementation

Future<void> tapAtDocumentPosition(DocumentPosition position, [Finder? superReaderFinder]) async {
  final documentLayout = _findDocumentLayout(superReaderFinder);
  final positionRectInDoc = documentLayout.getRectForPosition(position)!;
  final globalTapOffset = documentLayout.getAncestorOffsetFromDocumentOffset(positionRectInDoc.center);

  await tapAt(globalTapOffset);
}