rawFrame method Null safety

Uint8List? rawFrame()

Implementation

Uint8List? rawFrame() {
  if (!_formatMap.containsKey(format) || !isValid) return null;

  int size = width * height * (format == Format.FORMAT_GRAY ? 1 : 3);
  return data.cast<Uint8>().asTypedList(size);
}