buildBinary method

Future<Uint8List?> buildBinary()

Implementation

Future<Uint8List?> buildBinary() async {
  final image = this.image;
  if (image == null) {
    throw Exception("Make sure you have called finish() before calling this function");
  }

  final byteData = await image.toByteData(format: ui.ImageByteFormat.png);
  if (byteData == null) return null;

  return byteData.buffer.asUint8List();
}