backgroundLinearGradient method

Widget backgroundLinearGradient({
  1. Key? key,
  2. AlignmentGeometry begin = Alignment.centerLeft,
  3. AlignmentGeometry end = Alignment.centerRight,
  4. List<Color>? colors,
  5. List<double>? stops,
  6. TileMode tileMode = TileMode.clamp,
  7. GradientTransform? transform,
  8. 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,
        );
}