Gradient class sealed
A smooth transition between colors, used as a LayerPaint.gradient fill source in place of a solid LayerPaint.color.
Concrete subclasses (LinearGradient, RadialGradient, ConicGradient)
place their geometry in fractional coordinates (0.0..1.0) relative to
the painted layer's own size — the same convention LayerTransform.anchor
uses — so a gradient defined once keeps its relative position as the
layer is resized, and inherits the layer's rotation/scale automatically.
- Implementers
Constructors
-
Gradient.fromJson(Map<
String, Object?> json) -
Reconstructs a LinearGradient/RadialGradient/ConicGradient from
toJson's output, dispatching on its
'type'tag.factory
Properties
- extendMode → GradientExtendMode
-
How the gradient behaves outside its
0.0..1.0offset range.final - hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
stops
→ List<
GradientStop> -
The color ramp, in ascending GradientStop.offset order.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, Object?> -
Converts to a JSON-safe map, see
Scene.toJson. Each concrete subclass includes a'type'discriminator (fromJsonbelow dispatches on it), its own geometry, plus the stops/extendMode fields common to all three. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited