getImagePixels function
Implementation
Future<Uint32List> getImagePixels(Image image) async {
final c = Completer<Uint32List>();
image.toByteData(format: ImageByteFormat.rawRgba).then((data) {
c.complete(data!.buffer.asUint32List());
}).catchError((error) {
c.completeError(error);
});
return c.future;
}