childAtPosition method

RenderEditableBox childAtPosition(
  1. TextPosition position
)

Implementation

RenderEditableBox childAtPosition(TextPosition position) {
  assert(firstChild != null);

  final targetNode = _container.queryChild(position.offset, false).node;

  var targetChild = firstChild;
  while (targetChild != null) {
    if (targetChild.getContainer() == targetNode) {
      break;
    }
    targetChild = childAfter(targetChild);
  }
  if (targetChild == null) {
    throw 'targetChild should not be null';
  }
  return targetChild;
}