1. override
void fillGradient(GraphicsGradient gradient)

Source

@override
void fillGradient(GraphicsGradient gradient) {
  // TODO: Currently fillGradient is only supported in Canvas2D
  this.fillColor(0xFFFF00FF);
}