withGradient method

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

Implementation

Widget withGradient(
  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,
  );
}