paint method

  1. @override
void paint(
  1. PaintingContext context,
  2. Offset offset
)
override

Paints each child sliver onto the canvas.

The method loops over the cached _childrenState and paints each child at the calculated offset.

Implementation

@override
void paint(PaintingContext context, Offset offset) {
  if (!(geometry?.visible ?? false)) return;
  if (_childrenState == null) return; // No children to paint.

  double currentXOffset = 0;
  for (final childState in _childrenState!) {
    context.paintChild(childState.sliver, offset + Offset(currentXOffset, 0));
    currentXOffset += childState.size ?? 0;
  }
}