LinearGradient class

A Gradient that describes a linear gradient from from to to.

If offsets is provided, offsets[i] is a number from 0.0 to 1.0 that specifies where offsets[i] begins in the gradient. If offsets is not provided, then only two stops, at 0.0 and 1.0, are implied (and colors must therefore only have two entries).

The behavior before from and after to is described by the tileMode argument. For details, see the TileMode enum.

If transform is provided, the gradient fill will be transformed by the specified affine matrix relative to the local coordinate system.

Inheritance

Constructors

LinearGradient({required String id, required Point from, required Point to, List<Color>? colors, List<double>? offsets, TileMode? tileMode, GradientUnitMode? unitMode, AffineMatrix? transform})
Creates a new linear gradient shader.
const

Properties

colors List<Color>?
The colors to blend from the start to end points.
finalinherited
from Point
The start point of the gradient, as specified by tileMode.
final
hashCode int
The hash code for this object.
no setteroverride
id String
The reference identifier for this gradient.
finalinherited
offsets List<double>?
The positions to apply colors to. Must be the same length as colors.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tileMode TileMode?
Specifies the meaning of from and to.
finalinherited
to Point
The end point of the gradient, as specified by tileMode.
final
transform AffineMatrix?
The transform, if any, to apply to the gradient.
finalinherited
unitMode GradientUnitMode?
Whether the coordinates in this gradient should be transformed by the space this object occupies or by the root bounds.
finalinherited

Methods

applyBounds(Rect bounds, AffineMatrix transform) LinearGradient
Apply the bounds and transform the shader.
override
applyProperties(Gradient ref) LinearGradient
Creates a new gradient
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

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