1. override
void clear(int color)

Source

@override
void clear(int color) {

  setTransform(_identityMatrix);
  setBlendMode(BlendMode.NORMAL);
  setAlpha(1.0);

  int alpha = colorGetA(color);

  if (alpha < 255) {
    _renderingContext.clearRect(0, 0, _canvasElement.width, _canvasElement.height);
  }

  if (alpha > 0) {
    _renderingContext.fillStyle = color2rgba(color);
    _renderingContext.fillRect(0, 0, _canvasElement.width, _canvasElement.height);
  }
}