CanvasGradient class

The interface represents an opaque object describing a gradient. It is returned by the methods CanvasRenderingContext2D.createLinearGradient(), CanvasRenderingContext2D.createConicGradient() or CanvasRenderingContext2D.createRadialGradient(). It can be used as a fillStyle or strokeStyle.

Available extensions
Annotations
  • @JS()
  • @staticInterop

Constructors

CanvasGradient()
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addColorStop(double offset, String color) → void

Available on CanvasGradient, provided by the PropsCanvasGradient extension

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited