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 rx = box!.width / 2.0;
  final ry = box!.height / 2.0;

  if (child != null) {
    final mat = Matrix4.identity();
    mat.translate(box!.x, box!.y);
    context.canvas
      ..saveContext()
      ..drawEllipse(box!.x + rx, box!.y + ry, rx, ry)
      ..clipPath()
      ..setTransform(mat);
    child!.paint(context);
    context.canvas.restoreContext();
  }
}