withBackgroundGradient method
Applies a gradient as the widget's background.
Implementation
Widget withBackgroundGradient(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,
);
}