getOffsetOfLine method

int getOffsetOfLine(
  1. int lineNumber
)

Return the offset of the first character on the line with the given lineNumber.

Implementation

int getOffsetOfLine(int lineNumber) {
  if (lineNumber < 0 || lineNumber >= lineCount) {
    throw ArgumentError(
        'Invalid line number: $lineNumber; must be between 0 and ${lineCount - 1}');
  }
  return lineStarts[lineNumber];
}