capturePng2List method

Future<Uint8List?> capturePng2List(
  1. RenderRepaintBoundary boundary
)

Implementation

Future<Uint8List?> capturePng2List(RenderRepaintBoundary boundary) async {
  ui.Image image = await boundary.toImage(pixelRatio: 3.0);
  ByteData? byteData = await image.toByteData(format: ui.ImageByteFormat.png);
  Uint8List? pngBytes = byteData?.buffer.asUint8List();
  return pngBytes;
}