Snapshot constructor Null safety

Snapshot(
  1. String id,
  2. {String? render,
  3. String? layer,
  4. List<int>? image}
)

Implementation

Snapshot(this.id, {this.render, this.layer, this.image}) {
  if (render != null) {
    type = SnapshotType.render;
  } else if (layer != null) {
    type = SnapshotType.layer;
  } else if (image != null) {
    type = SnapshotType.image;
  } else {
    throw Exception('Snapshot: Incorrect construction of Snapshot');
  }
}