pngBytes property

Future<Uint8List?> get pngBytes

Returns the image byte data from the this as a Uint8List in png format.

Implementation

Future<Uint8List?> get pngBytes async {
  // Convert this image into byte data with the png format
  final byteData = await toByteData(format: ui.ImageByteFormat.png);

  // Return the Uint8List from the byte data buffer (if not null)
  return byteData?.buffer.asUint8List();
}