DrawingCanvas constructor

DrawingCanvas(
  1. int width,
  2. int height
)

Implementation

DrawingCanvas(this.width, this.height) {
  if (width % 2 != 0) {
    throw Exception('Width must be a multiple of 2!');
  }

  if (height % 4 != 0) {
    throw Exception('Height must be a multiple of 4!');
  }

  content = List<int>.filled(width * height ~/ 8, 0);
  _fillContent();
}