toImage static method

Future<Image> toImage(
  1. Uint8List data, {
  2. int? width,
  3. int? height,
})

Implementation

static Future<ui.Image> toImage(Uint8List data, {int? width, int? height}) async {
  final codec = await ui.instantiateImageCodec(
    data,
    targetHeight: height,
    targetWidth: width,
    allowUpscaling: true,
  );
  final image = (await codec.getNextFrame()).image;
  return image;
}