paint method

  1. @override
void paint(
  1. Canvas canvas,
  2. Size size
)
override

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();
}