render method
Implementation
Future<Image?> render(int width, int height) async {
if (_hasCleaned) {
return null;
}
final (pixmap, pixels) = await Isolate.run(() => _render(width, height));
final completer = Completer<Image>();
decodeImageFromPixels(pixels, width, height, PixelFormat.rgba8888, (image) {
malloc.free(pixmap);
if (shouldClean && !_hasCleaned) {
_hasCleaned = true;
_dispose();
}
completer.complete(image);
});
return completer.future;
}