I have this scenario where I have to get a UInt8List from an image like that:
List stuff = image.toByteData().buffer.asUInt8List()
Do some manipulations and get back to a Image.
I've tried the following:
List stuff = image.toByteData().buffer.asUInt8List()
ui.decodeImageFromList(stuff, (image){
// do stuff with image
});
But I keep getting this Exception:
E/flutter (10201): [ERROR:flutter/lib/ui/painting/codec.cc(97)] Failed decoding image. Data is either invalid, or it is encoded using an unsupported format.
E/flutter (10201): [ERROR:flutter/shell/common/shell.cc(186)] Dart Error: Unhandled exception:
...
Take notice that even without any changes in the List the exception is thrown. How can I make the list have a encodable format?