PrimitiveGradient class Null safety

The most basic representation of a gradient.



PrimitiveGradient.byCombination(Gradient a, Gradient b, double t)
Vanilla Flutter gradient merge process. [...]
PrimitiveGradient.byProgressiveMerge(PrimitiveGradient a, PrimitiveGradient b, double t)
This factory constructor will return a PrimitiveGradient whose colors and stops are progressively merged (as t progresses from 0.0 -> 1.0) by lerping any entries that fall within a shared common list length range and adding any potential extra entries sourced from b as t grows while removing any potential extra entries sourced from a as t grows.
PrimitiveGradient.from(Gradient gradient)
Dissolve a Gradient into a PrimitiveGradient. [...]
PrimitiveGradient.fromStretchLerp(dynamic a, dynamic b, double t)
Interpolate two Gradients' or PrimitiveGradients' colors and stops at t. [...]


colors List<Color>
The interpolated colors of the true Gradients that this PrimitiveGradient boils down.
hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
stops List<double>
The interpolated stops of the true Gradients that this PrimitiveGradient boils down.


noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
scale(double factor) PrimitiveGradient
"Scaling" this gradient represents reducing the opacity of all its colors by Color.lerp with null using factor as the keyframe t.
stretchedTo(int length) PrimitiveGradient
Force this PrimitiveGradient to have length number of colors/stops. [...]
toString() String
A string representation of this object. [...]


operator ==(Object other) bool
The equality operator. [...]

Static Methods

extrapolateStop(List<double> stops, double t) double
Extrapolate the stop at position t from a configured list of stops. [...]
sameLengthLerp(PrimitiveGradient a, PrimitiveGradient b, double t) PrimitiveGradient
Linearally interpolate between PrimitiveGradients a and b at any given keyframe (double) t, generally 0.0 .. 1.0. [...]
sample(List<Color> colors, List<double> stops, double t) Color
Calculate the color at position t of the gradient defined by colors and stops.
Modified from vanilla Gradient _sample() to support fewer Colors. [...]