paint method
Draw this layer onto canvas.
Implementation
@override
void paint(Canvas canvas, Size size) {
if (selectedIndex == null) return;
final cx = getX(selectedIndex!);
canvas.drawRect(
Rect.fromLTWH(
cx - slotWidth / 2,
viewport.top,
slotWidth,
viewport.height,
),
paintCache.fill(highlightColor),
);
clearDirty();
}