render method
Renders the widget onto the provided buffer within the specified area.
Implementation
@override
void render(Buffer buffer, Rect area) {
if (area.width <= 0 || area.height <= 0 || itemCount <= 0) return;
scrollOffset = scrollOffset.clamp(0, itemCount - 1);
for (var i = 0; i < area.height; i++) {
final index = scrollOffset + i;
if (index >= itemCount) break;
final childWidget = itemBuilder(index);
final childArea = Rect(0, i, area.width, 1);
final vp = Viewport(buffer, childArea);
childWidget.render(vp, Rect(0, 0, area.width, 1));
}
}