AnimatedGradientBackground class

A beautiful animated gradient background widget for Flutter.

This widget provides smooth animated gradient backgrounds with customizable colors, animation speed, and gradient patterns.

Inheritance

Constructors

AnimatedGradientBackground({Key? key, required Widget child, required List<Color> colors, Duration duration = const Duration(seconds: 3), GradientType gradientType = GradientType.linear, LinearGradientDirection? linearDirection, Alignment? radialCenter, double? radialRadius, Alignment? sweepCenter, double? sweepStartAngle, double? sweepEndAngle, bool repeat = true, Curve curve = Curves.easeInOut})
Creates an AnimatedGradientBackground widget.
const

Properties

child Widget
The child widget to display on top of the gradient background.
final
colors List<Color>
List of colors to use in the gradient animation. Must contain at least 2 colors.
final
curve Curve
The curve for the animation. Defaults to Curves.easeInOut.
final
duration Duration
Duration of the animation cycle. Defaults to 3 seconds.
final
gradientType GradientType
The type of gradient to animate. Defaults to GradientType.linear.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
linearDirection LinearGradientDirection?
The direction of the linear gradient. Only used when gradientType is GradientType.linear. Defaults to LinearGradientDirection.topLeftToBottomRight.
final
radialCenter Alignment?
The center of the radial gradient. Only used when gradientType is GradientType.radial. Defaults to Alignment.center.
final
radialRadius double?
The radius of the radial gradient. Only used when gradientType is GradientType.radial. Defaults to 0.8.
final
repeat bool
Whether the animation should repeat automatically. Defaults to true.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sweepCenter Alignment?
The center of the sweep gradient. Only used when gradientType is GradientType.sweep. Defaults to Alignment.center.
final
sweepEndAngle double?
The end angle of the sweep gradient in radians. Only used when gradientType is GradientType.sweep. Defaults to 2 * π.
final
sweepStartAngle double?
The start angle of the sweep gradient in radians. Only used when gradientType is GradientType.sweep. Defaults to 0.0.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<AnimatedGradientBackground>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited