decodeWithCheck static method

Image decodeWithCheck(
  1. Uint8List bytes
)

Implementation

static Image decodeWithCheck(Uint8List bytes) {
  Image? image = decodeImage(bytes);
  // image.set
  if (image == null) {
    throw StateError("No image can be decoded from input data.");
  }
  return image;
}