GradientUtils extension
Offers copyWith method to make duplicate Gradient
s as well as global
getters for any Gradient with specific fallbacks; reversed to
easily return a Gradient
with its colors reversed; and animate, as a
shortcut to provide this
Gradient as an AnimatedGradient's source
and return the AnimatedGradient.observe output.
- on
Properties
- begin → AlignmentGeometry
-
If this is a linear-type
Gradient
, returnsthis.begin
. Otherwise the fallback retrun value is Alignment.center.no setter - center → AlignmentGeometry
-
If this is a radial- or sweep-type
Gradient
, returnsthis.center
. Otherwise the fallback retrun value is Alignment.center.no setter - distance → double
-
If this is a
ShadedSteps
-typeGradient
, returnsthis.distance
. Otherwise the fallback retrun value is0.0
.no setter - end → AlignmentGeometry
-
If this is a linear-type
Gradient
, returnsthis.end
. Otherwise the fallback retrun value is Alignment.center.no setter - endAngle → double
-
If this is a sweep-type
Gradient
, returnsthis.endAngle
. Otherwise the fallback retrun value is0.0
.no setter - focal → AlignmentGeometry?
-
If this is a radial-type
Gradient
, returnsthis.focal
which may benull
. Otherwise the fallback retrun value isnull
.no setter - focalRadius → double
-
If this is a radial-type
Gradient
, returnsthis.focalRadius
. Otherwise the fallback retrun value is0.0
.no setter - radius → double
-
If this is a radial-type
Gradient
, returnsthis.radius
. Otherwise the fallback retrun value is0.0
.no setter - reversed → Gradient
-
Returns a copy of this
Gradient
with itsList<Color>
colors
reversed as well as any potential stops.no setter - shadeFactor → double
-
If this is a
ShadedSteps
-typeGradient
, returnsthis.shadeFactor
. Otherwise the fallback retrun value is0
.no setter - shadeFunction → ColorArithmetic
-
If this is a
ShadedSteps
-typeGradient
, returnsthis.shadeFunction
. Otherwise the fallback retrun value is Shades.withWhite.no setter - softness → double
-
If this is a Steps-type
Gradient
, returnsthis.softness
. Otherwise the fallback retrun value is0.0
.no setter - startAngle → double
-
If this is a sweep-type
Gradient
, returnsthis.startAngle
. Otherwise the fallback retrun value is0.0
.no setter -
steppedColors
→ List<
Color> -
If this is a Steps-type
Gradient
, returnsthis.steppedColors
. Otherwise the fallback retrun value iscolors
.no setter -
steppedStops
→ List<
double> ? -
If this is a Steps-type
Gradient
, returnsthis.steppedStops
. Otherwise the fallback retrun value isstops
.no setter - tileMode → TileMode
-
How this
Gradient
tiles in the plane beyond the region before its starting stop and after its ending stop.no setter
Methods
-
animate(
{required Animation< double> controller, Map<GradientAnimation, dynamic> storyboard = const {}, GradientCopyWith overrideCopyWith = spectrumCopyWith}) → Gradient -
Returns the AnimatedGradient.observe animated
Gradient
output from anew AnimatedGradient
constructed bythis
gradient and the provided parameters. -
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 -
📋 Returns a new copy of this
Gradient
with any appropriate optional parameters overriding those ofthis
.