Dart Documentationorson_chartsGradientRectanglePainter

GradientRectanglePainter class

A rectangle painter that draws a linear color gradient between two user-specified points in the rectangle.

Implements

RectanglePainter

Constructors

new GradientRectanglePainter(Color color1, Anchor2D anchor1, Color color2, Anchor2D anchor2) #

Creates a new instance.

Properties

final Anchor2D anchor1 #

Returns the anchor point used to find the starting point for the gradient (as specified via the constructor). There is no setter method because instances of this class are immutable.

final Anchor2D anchor2 #

Returns the anchor point used to find the ending point for the gradient (as specified via the constructor). There is no setter method because instances of this class are immutable.

final Color color1 #

Returns the first color for the gradient (as specified via the constructor). There is no setter method because instances of this class are immutable.

final Color color2 #

Returns the second color for the gradient (as specified via the constructor). There is no setter method because instances of this class are immutable.

Methods

dynamic fill(CanvasRenderingContext2D context, Rectangle bounds) #

Fills the specified <code>area</code> with a gradient paint created using the colors and anchor points of this painter.