render method
Renders the widget onto the provided buffer within the specified area.
Implementation
@override
void render(Buffer buffer, Rect area) {
adjustScroll(area.height);
for (var i = 0; i < area.height; i++) {
final itemIdx = scrollOffset + i;
if (itemIdx >= items.length) break;
final isSelected = itemIdx == selectedIndex;
final text = items[itemIdx];
// Pad line to fit full width in a grapheme-safe way
final chars = text.characters;
final padded = chars.length >= area.width
? chars.take(area.width).toString()
: chars.toString() + (' ' * (area.width - chars.length));
buffer.writeString(0, i, padded, isSelected ? selectedStyle : itemStyle);
}
}