canvas property

Canvas get canvas

The current canvas, should only be accessed from paint methods.

Implementation

Canvas get canvas {
  assert(() {
    if (debugPhase != BoxyDelegatePhase.paint) {
      throw FlutterError(
          'The $this boxy delegate attempted to access the canvas outside of a paint method.');
    }
    return true;
  }());
  return paintingContext.canvas;
}