RadialGradient class

Creates a radial gradient centered at center that ends at radius distance from the center.

If offsets is provided, offsets[i] is a number from 0.0 to 1.0 that specifies where colors[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 and after the radius 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.

If focalPoint is provided and not equal to center and focalRadius is provided and not equal to 0.0, the generated shader will be a two point conical radial gradient, with focalPoint being the center of the focal circle. If focalPoint is provided and not equal to center, at least one of the two offsets must not be equal to Point.zero.

Inheritance

Constructors

RadialGradient({required String id, required Point center, required double radius, List<Color>? colors, List<double>? offsets, TileMode? tileMode, AffineMatrix? transform, Point? focalPoint, GradientUnitMode? unitMode})
Creates a new radial gradient object with the specified properties.
const

Properties

center Point
The central point of the gradient.
final
colors List<Color>?
The colors to blend from the start to end points.
finalinherited
focalPoint Point?
If specified, creates a two-point conical gradient using center and the focalPoint.
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
radius double
The colors to blend from the start to end points.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tileMode TileMode?
Specifies the meaning of from and to.
finalinherited
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) RadialGradient
Apply the bounds and transform the shader.
override
applyProperties(Gradient ref) RadialGradient
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