paint method

  1. @override
void paint(
  1. Context context
)
override

Draw itself and its children, according to the calculated box.offset

Implementation

@override
void paint(Context context) {
  super.paint(context);

  final mat = Matrix4.identity();
  mat.translate(box!.x, box!.y);
  context.canvas
    ..saveContext()
    ..setTransform(mat);
  if (overflow == Overflow.clip) {
    context.canvas
      ..drawRect(0, 0, box!.width, box!.height)
      ..clipPath();
  }
  for (final child in children) {
    child.paint(context);
  }
  context.canvas.restoreContext();
}