placeCaretInParagraph method

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

Place the caret at the given offset in a paragraph with the given nodeId, by simulating a user gesture.

The simulated user gesture is probably a tap, but the only guarantee is that the caret is placed with a gesture.

To explicitly simulate a tap within a paragraph, use tapInParagraph.

Implementation

Future<void> placeCaretInParagraph(
  String nodeId,
  int offset, {
  TextAffinity affinity = TextAffinity.downstream,
  Finder? superEditorFinder,
}) async {
  await _tapInParagraph(nodeId, offset, affinity, 1, superEditorFinder);
}