getLineLayout method
Gets the layout parameters (width and x-offset) for a line at a specific Y position. Returns null if the line is outside the displayable area.
Implementation
@override
({int width, int xOffset})? getLineLayout(double lineY, double lineHeight) {
if (lineY < 0 || lineY + lineHeight > height) {
return null; // Line is outside the vertical bounds.
}
return (width: width, xOffset: 0);
}