ColorMatrixFilter constructor Null safety

ColorMatrixFilter(
  1. List<num> colorMatrix,
  2. List<num> colorOffset
)

Implementation

ColorMatrixFilter(List<num> colorMatrix, List<num> colorOffset) {
  if (colorMatrix.length != 16) throw ArgumentError('colorMatrix');
  if (colorOffset.length != 4) throw ArgumentError('colorOffset');

  for (var i = 0; i < colorMatrix.length; i++) {
    _colorMatrixList[i] = colorMatrix[i].toDouble();
  }

  for (var i = 0; i < colorOffset.length; i++) {
    _colorOffsetList[i] = colorOffset[i].toDouble();
  }
}