buildViewportFrame method
Implementation
ViewportFrame buildViewportFrame({
required double viewTop,
required double viewBottom,
required double fallbackLineHeight,
}) {
final range = visibleRangeByHeight(
viewTop: viewTop,
viewBottom: viewBottom,
);
final summaries = [
for (
var i = range.firstLine;
i <= range.lastLine && i < _root.summary.lines;
i++
) ...[
() {
final line = _root.lineAt(i);
return LineSummary(
lenChars: BigInt.from(line.lenChars),
height: line.visibleHeight == 0
? fallbackLineHeight
: line.visibleHeight,
lines: BigInt.one,
);
}(),
],
];
return ViewportFrame(
firstLine: range.firstLine,
lastLine: range.lastLine,
firstLineY: range.firstLineY,
lines: summaries,
);
}