MapColorMapper constructor Null safety

const MapColorMapper(
  1. {double? from,
  2. double? to,
  3. String? value,
  4. required Color color,
  5. double? minOpacity,
  6. double? maxOpacity,
  7. String? text}
)

Creates a MapColorMapper.

Implementation

const MapColorMapper({
  this.from,
  this.to,
  this.value,
  required this.color,
  this.minOpacity,
  this.maxOpacity,
  this.text,
})  : assert((from == null && to == null) ||
          (from != null && to != null && from < to && to > from)),
      assert(minOpacity == null || minOpacity != 0),
      assert(maxOpacity == null || maxOpacity != 0);