LinearShadedSteps class
Construct a new LinearShadedSteps
that progresses from one color to the
next in hard steps, each with its own intrinsic "shading," as opposed to
smooth transitions by way of "quadruplicating" colors and stops.
Consider LinearSteps for more information.
The difference for FooShadedSteps
is that instead of duplicating a color
to make it hard step at each transition, each color and stop is laid out
according to a softness
, shadeFunction
and shadeFactor
to provide the
same effect across four entries instead of only two and allow greater
control over the inner appearance of each given step.
- Inheritance
-
- Object
- Gradient
- Steps
- LinearSteps
- LinearShadedSteps
- Available extensions
Constructors
-
LinearShadedSteps.new({ColorArithmetic shadeFunction = Shades.withWhite, double shadeFactor = -90, double distance = 0.6, double softness = 0.0, required List<
Color> colors, List<double> ? stops, AlignmentGeometry begin = Alignment.centerLeft, AlignmentGeometry end = Alignment.centerRight, TileMode tileMode = TileMode.clamp, GradientTransform? transform}) -
A standard Steps gradient differs from the average Gradient in its
progression from one color to the next. Instead of smoothly transitioning
between colors,
Steps
have hard edges created by duplicating colors and stops.const
Properties
- asGradient → LinearGradient
-
Resolve these
Steps
to its smoothGradient
counterpart by colors and stops duplication, considering softness.no setterinherited - asNill → Gradient
-
Available on Gradient, provided by the NillGradients extension
Gradient get asNill => nillify( /* this. */ runtimeType);no setter - begin → AlignmentGeometry
-
The color that correlates to
stops
entry0
(the first color) is placed atAlignmentGeometry
begin and the final stop is placed at end, with all the intermediate colors filling the space between them.finalinherited - begin → AlignmentGeometry
-
Available on Gradient, provided by the GradientUtils extension
If this is a linear-typeGradient
, returnsthis.begin
. Otherwise the fallback retrun value is Alignment.center.no setter - center → AlignmentGeometry
-
Available on Gradient, provided by the GradientUtils extension
If this is a radial- or sweep-typeGradient
, returnsthis.center
. Otherwise the fallback retrun value is Alignment.center.no setter -
colors
→ List<
Color> -
The colors the gradient should obtain at each of the stops.
finalinherited
- distance → double
-
A value between
0.0 .. 1.0
, defaulting at0.6
, that places the "midpoint" for each color shading function in theSteps
.final - distance → double
-
Available on Gradient, provided by the GradientUtils extension
If this is aShadedSteps
-typeGradient
, returnsthis.distance
. Otherwise the fallback retrun value is0.0
.no setter - end → AlignmentGeometry
-
The color that correlates to
stops
entry0
(the first color) is placed atAlignmentGeometry
begin and the final stop is placed at end, with all the intermediate colors filling the space between them.finalinherited - end → AlignmentGeometry
-
Available on Gradient, provided by the GradientUtils extension
If this is a linear-typeGradient
, returnsthis.end
. Otherwise the fallback retrun value is Alignment.center.no setter - endAngle → double
-
Available on Gradient, provided by the GradientUtils extension
If this is a sweep-typeGradient
, returnsthis.endAngle
. Otherwise the fallback retrun value is0.0
.no setter - focal → AlignmentGeometry?
-
Available on Gradient, provided by the GradientUtils extension
If this is a radial-typeGradient
, returnsthis.focal
which may benull
. Otherwise the fallback retrun value isnull
.no setter - focalRadius → double
-
Available on Gradient, provided by the GradientUtils extension
If this is a radial-typeGradient
, returnsthis.focalRadius
. Otherwise the fallback retrun value is0.0
.no setter - hashCode → int
-
The hash code for this object.
no setterinherited
- radius → double
-
Available on Gradient, provided by the GradientUtils extension
If this is a radial-typeGradient
, returnsthis.radius
. Otherwise the fallback retrun value is0.0
.no setter - reversed → Gradient
-
Available on Gradient, provided by the GradientUtils extension
Returns a copy of thisGradient
with itsList<Color>
colors reversed as well as any potential stops.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shadeFactor → double
-
A
double
to provide to shadeFunction when "shading" each colored step.final - shadeFactor → double
-
Available on Gradient, provided by the GradientUtils extension
If this is aShadedSteps
-typeGradient
, returnsthis.shadeFactor
. Otherwise the fallback retrun value is0
.no setter - shadeFunction → ColorArithmetic
-
For any given "step", comprised of a single color "quadruplicated" across
four stops, the
shadeFunction
will be called on the color and this result is placed as the fourth, final stop for this color step.final - shadeFunction → ColorArithmetic
-
Available on Gradient, provided by the GradientUtils extension
If this is aShadedSteps
-typeGradient
, returnsthis.shadeFunction
. Otherwise the fallback retrun value is Shades.withWhite.no setter - softness → double
-
An incredibly small
double
to provide as anadditive
for each second entry when duplicating stops for thisSteps
.finalinherited - softness → double
-
Available on Gradient, provided by the GradientUtils extension
If this is a Steps-typeGradient
, returnsthis.softness
. Otherwise the fallback retrun value is0.0
.no setter - startAngle → double
-
Available on Gradient, provided by the GradientUtils extension
If this is a sweep-typeGradient
, returnsthis.startAngle
. Otherwise the fallback retrun value is0.0
.no setter -
steppedColors
→ List<
Color> -
Overrides
Steps
property to "quadruplicate" with shading instead of only duplicating.no setteroverride -
steppedColors
→ List<
Color> -
Available on Gradient, provided by the GradientUtils extension
If this is a Steps-typeGradient
, returnsthis.steppedColors
. Otherwise the fallback retrun value is colors.no setter -
steppedStops
→ List<
double> -
Overrides
Steps
property to "quadruplicate" with shading instead of only duplicating.no setteroverride -
steppedStops
→ List<
double> ? -
Available on Gradient, provided by the GradientUtils extension
If this is a Steps-typeGradient
, returnsthis.steppedStops
. Otherwise the fallback retrun value is stops.no setter -
stops
→ List<
double> ? -
A list of values from 0.0 to 1.0 that denote fractions along the gradient.
finalinherited
- tileMode → TileMode
-
How these
Steps
should tile the plane beyond the region before its starting stop and after its ending stop.finalinherited - tileMode → TileMode
-
Available on Gradient, provided by the GradientUtils extension
How thisGradient
tiles in the plane beyond the region before its starting stop and after its ending stop.no setter - transform → GradientTransform?
-
The transform, if any, to apply to the gradient.
finalinherited
Methods
-
animate(
{required Animation< double> controller, Map<GradientAnimation, dynamic> storyboard = const {}, GradientCopyWith overrideCopyWith = spectrumCopyWith}) → Gradient -
Available on Gradient, provided by the GradientUtils extension
Returns the AnimatedGradient.observe animatedGradient
output from anew AnimatedGradient
constructed bythis
gradient and the provided parameters. -
copyWith(
{ColorArithmetic? shadeFunction, double? shadeFactor, double? distance, double? softness, List< Color> ? colors, List<double> ? stops, AlignmentGeometry? begin, AlignmentGeometry? end, TileMode? tileMode, GradientTransform? transform}) → LinearShadedSteps -
📋 Returns a new copy of this
LinearShadedSteps
with any provided optional parameters overriding those ofthis
.override -
copyWith(
{List< Color> ? colors, List<double> ? stops, GradientTransform? transform, TileMode? tileMode, AlignmentGeometry? begin, AlignmentGeometry? end, AlignmentGeometry? center, double? radius, AlignmentGeometry? focal, double? focalRadius, double? startAngle, double? endAngle, double? softness, ColorArithmetic? shadeFunction, double? shadeFactor, double? distance}) → Gradient -
Available on Gradient, provided by the GradientUtils extension
📋 Returns a new copy of thisGradient
with any appropriate optional parameters overriding those ofthis
. -
createShader(
Rect rect, {TextDirection? textDirection}) → Shader -
Resolve these
Steps
to its smoothGradient
counterpart, then use that gradient'screateShader()
method.inherited -
lerpFrom(
Gradient? a, double t) → Gradient? -
Linearly interpolates from another Gradient to
this
.override -
lerpTo(
Gradient? b, double t) → Gradient? -
Linearly interpolates from
this
to another Gradient.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
scale(
double factor) → LinearShadedSteps -
Returns a new LinearSteps with its colors scaled by the given factor.
Since the alpha channel is what receives the scale factor,
0.0
or less results in a gradient that is fully transparent.override -
toString(
) → String -
A string representation of this object.
override
-
withOpacity(
double opacity) → Gradient -
Returns a new Gradient with each color set to the given opacity.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Static Methods
-
lerp(
LinearShadedSteps? a, LinearShadedSteps? b, double t) → Gradient? -
Linearly interpolate between two LinearSteps.
override