imgToRgba function
Converts an Image object to raw RGBA bytes.
Parameters:
- image: The source
Imageobject
Returns a Future that completes with the image data as RGBA bytes.
Implementation
Future<Uint8List> imgToRgba(Image image) async {
final data = await image.toByteData(format: ImageByteFormat.rawRgba);
return data!.buffer.asUint8List();
}