gradientBackground method

Widget gradientBackground(
  1. List<Color> colors, {
  2. Alignment begin = Alignment.topLeft,
  3. Alignment end = Alignment.bottomRight,
})

Adds a gradient background to the widget.

Implementation

Widget gradientBackground(List<Color> colors, {Alignment begin = Alignment.topLeft, Alignment end = Alignment.bottomRight}) {
  return Container(
    decoration: BoxDecoration(
      gradient: LinearGradient(
        colors: colors,
        begin: begin,
        end: end,
      ),
    ),
    child: this,
  );
}