toImage static method
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;
}