AdGradient constructor

AdGradient({
  1. required String type,
  2. List<Color>? colors,
  3. AdGradientOrientation? orientation,
  4. Alignment gradientCenter = const Alignment(0.5, 0.5),
  5. double? radialGradientRadius,
})

Implementation

AdGradient({
  required this.type,
  this.colors,
  this.orientation,
  this.gradientCenter = const Alignment(0.5, 0.5),
  this.radialGradientRadius,
})  : assert(
        [LINEAR, RADIAL].contains(type),
        'You must specify a valid gradient type. It can be: $LINEAR or $RADIAL',
      ),
      assert(
        colors != null && colors.length >= 2,
        'You must specify at least two colors',
      );