AnimatedGradient class Null safety

An AnimatedWidget that expects to be provided an initialized Listenable.

Breaks the mold for AnimatedWidgets naming schemes (except for the AnimatedWidget itself) as most AnimatedFoo class objects actually extend ImplicitlyAnimatedWidget and handle their own AnimationController. But since this AnimatedGradient is not intended to ever be built, there is no means for managing the lifecycle of said controller.

  • If this Widget is treed out and built, however, the return is a DecoratedBox whose gradient is set to observe.

Use a new AnimatedGradient and its observe property for Gradient-type return, provided some Animation<double> controller, to drive a customizable animation on the gradientInput by tweaking this object's storyboard map of GradientAnimations.



AnimatedGradient({Key? key, required Animation<double> controller, required Gradient gradient, Map<GradientAnimation, dynamic> storyboard = const {}, GradientCopyWith overrideCopyWith = spectrumCopyWith})
Use this object's observe property, after providing some controller, to drive a customizable animation on the gradientInput by tweaking the storyboard map of GradientAnimations. [...]


animation Animation<double>
The provided Animation<double> from construction, accessed as super.listenable.
gradientInput Gradient
The Gradient provided at construction. [...]
hashCode int
The hash code for this object. [...]
@nonVirtual, read-only, inherited
key Key?
Controls how one widget replaces another widget in the tree. [...]
final, inherited
listenable Listenable
The Listenable to which this widget is listening. [...]
final, inherited
observe Gradient
Observe the output Gradient which applies modifications to the gradientInput based on the animation and other provided properties, considering storyboard and the relevant mappings from
GradientAnimations -> dynamic, where dynamic matches with the key: [...]
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
storyboard Map<GradientAnimation, dynamic>
Mappings from GradientAnimations -> dynamic, where dynamic matches with the key: [...]


build(BuildContext context) Widget
An AnimatedGradient is not intended to be built directly like a true Widget. Instead opt to observe for the direct Gradient- type output. [...]
createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree. [...]
createState() State<AnimatedWidget>
Subclasses typically do not override this method.
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children. [...]
@protected, inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep. [...]
toString({DiagnosticLevel minLevel =}) String
A string representation of this object. [...]
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants. [...]
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object. [...]
toStringShort() String
A short, textual description of this widget.


operator ==(Object other) bool
The equality operator. [...]
@nonVirtual, inherited