getLineNumberAt abstract method

int? getLineNumberAt(
  1. int codeUnitOffset
)

Returns the line number of the line that contains the code unit that codeUnitOffset points to.

This method returns null if the given codeUnitOffset is out of bounds, or is logically after the last visible codepoint. This includes the case where its codepoint belongs to a visible line, but the text layout library replaced it with an ellipsis.

If the target code unit points to a control character that introduces mandatory line breaks (most notably the line feed character LF, typically represented in strings as the escape sequence "\n"), to conform to the unicode rules, the control character itself is always considered to be at the end of "current" line rather than the beginning of the new line.

Implementation

int? getLineNumberAt(int codeUnitOffset);