backgroundLinearGradient method
Widget
backgroundLinearGradient({
- Key? key,
- AlignmentGeometry begin = Alignment.centerLeft,
- AlignmentGeometry end = Alignment.centerRight,
- List<
Color> ? colors, - List<
double> ? stops, - TileMode tileMode = TileMode.clamp,
- GradientTransform? transform,
- bool animate = false,
Implementation
Widget backgroundLinearGradient({
Key? key,
AlignmentGeometry begin = Alignment.centerLeft,
AlignmentGeometry end = Alignment.centerRight,
List<Color>? colors,
List<double>? stops,
TileMode tileMode = TileMode.clamp,
GradientTransform? transform,
bool animate = false,
}) {
BoxDecoration decoration = BoxDecoration(
gradient: LinearGradient(
begin: begin,
end: end,
colors: colors ?? [],
stops: stops,
tileMode: tileMode,
transform: transform,
),
);
return animate
? _StyledAnimatedBuilder(
key: key,
builder: (animation) {
return _AnimatedDecorationBox(
child: this,
decoration: decoration,
duration: animation.duration,
curve: animation.curve,
);
},
)
: DecoratedBox(
key: key,
child: this,
decoration: decoration,
);
}