draw method

  1. @nonVirtual
void draw(
  1. Draw draw
)

Draws to canvas every frame, in this node's own coordinate space.

draw((canvas) {
  canvas.drawCircle(.zero, radius, paint);
});

Discarded by the next build. Only valid inside this node's own build.

Implementation

@nonVirtual
void draw(Draw draw) {
  assert(
    identical(_building, this),
    'draw() is only available inside this node\'s own build.',
  );

  (_draws ??= []).add(draw);
}