paintStack method

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

Override in subclasses to customize how the stack paints.

By default, the stack uses defaultPaint. This function is called by paint after potentially applying a clip to contain visual overflow.

Implementation

@override
void paintStack(PaintingContext context, Offset offset) {
  final RenderBox? displayedChild = _childAtIndex();
  if (displayedChild == null) {
    return;
  }
  final StackParentData childParentData = displayedChild.parentData! as StackParentData;
  context.paintChild(displayedChild, childParentData.offset + offset);
}