getImage method Null safety

dynamic getImage()

Implementation

imglib.Image? getImage() {
  Uint8List? rawFrameData = rawFrame();

  if (rawFrameData == null) {
    return null;
  }

  return imglib.Image.fromBytes(width: width, height: height, bytes: rawFrameData.buffer, order: _formatMap[format]!);
}