IrGradient constructor

IrGradient({
  1. required List<IrColor> colors,
  2. List<double>? stops,
  3. bool radial = false,
  4. bool sweep = false,
  5. double rotation = 0,
  6. (double, double) begin = (0, 0.5),
  7. (double, double) end = (1, 0.5),
  8. (double, double) center = (0.5, 0.5),
  9. double radius = 0.5,
  10. (double, double)? size,
})

Implementation

IrGradient({
  required this.colors,
  List<double>? stops,
  this.radial = false,
  this.sweep = false,
  this.rotation = 0,
  this.begin = (0, 0.5),
  this.end = (1, 0.5),
  this.center = (0.5, 0.5),
  this.radius = 0.5,
  this.size,
}) : stops =
         stops ??
         [
           for (var i = 0; i < colors.length; i++)
             colors.length == 1 ? 0 : i / (colors.length - 1),
         ];