captureAsPngBytes method

Future<Uint8List> captureAsPngBytes([
  1. double? pixelRatio
])

refer to capture.

Implementation

Future<Uint8List> captureAsPngBytes([double? pixelRatio]) async {
  final image = capture(pixelRatio);
  final bytes = await image.toByteData(format: ui.ImageByteFormat.png);
  return bytes!.buffer.asUint8List();
}