getSpanForPosition method

InlineSpan getSpanForPosition (TextPosition position)

Returns the InlineSpan that contains the given position in the text.

Implementation

InlineSpan getSpanForPosition(TextPosition position) {
  assert(debugAssertIsValid());
  final Accumulator offset = Accumulator();
  InlineSpan result;
  visitChildren((InlineSpan span) {
    result = span.getSpanForPositionVisitor(position, offset);
    return result == null;
  });
  return result;
}