BackgroundSpec constructor

const BackgroundSpec({
  1. required BackgroundKind kind,
  2. required List<int> colors,
  3. int angleTenths = 0,
  4. BackgroundPattern pattern = BackgroundPattern.none,
  5. int patternColor = 0,
  6. int patternScaleCdp = 0,
  7. int patternOpacityPermille = 0,
  8. int driftPeriodMs = 0,
})

colors must be unmodifiable (a const literal, or wrapped with List.unmodifiable): specs are deeply immutable and cache their stable hash. The generator, copyWith and fromJson all comply.

Implementation

const BackgroundSpec({
  required this.kind,
  required this.colors,
  this.angleTenths = 0,
  this.pattern = BackgroundPattern.none,
  this.patternColor = 0,
  this.patternScaleCdp = 0,
  this.patternOpacityPermille = 0,
  this.driftPeriodMs = 0,
});