Open dhrutimehta opened 5 months ago
Yes please look into this issue
can you shard the code with me?
I am also facing similar kind of issue
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Exception: Unable to find RenderRepaintBoundary
Future<Uint8List?> capture({ double pixelRatio = 6, }) async { try { return await Future.delayed(Duration.zero, () async { RenderRepaintBoundary? boundary = containerKey.currentContext?.findRenderObject() as RenderRepaintBoundary?;
if (boundary == null) {
throw Exception('Unable to find RenderRepaintBoundary');
}
final image = await boundary.toImage(pixelRatio: pixelRatio);
final byteData = await image.toByteData(format: ui.ImageByteFormat.png);
final pngBytes = byteData?.buffer.asUint8List();
return pngBytes;
});
} catch (e) {
rethrow;
}
}
static Future
error : [ERROR:flutter/lib/ui/painting/image_encoding.cc(210)] Could not convert raster image to PNG.