I am trying to write an image to canvas using Picture recorder...
drawImage requires dart:ui image
I have successfully imported asset image but getting following error for network image:
[VERBOSE-2:codec.cc(97)] Failed decoding image. Data is either invalid, or it is encoded using an unsupported format.
[VERBOSE-2:shell.cc(186)] Dart Error: Unhandled exception: Exception: operation failed 0 _rootHandleUncaughtError. (dart:async/zone.dart:1112:29) 1 _microtaskLoop (dart:async/schedule_microtask.dart:41:21) 2 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
code tried so far..
netImage.obtainKey(new ImageConfiguration()).then((val) {
var load = netImage.load(val);
load.addListener((listener, err) async {
ImageInfo imageInfo;
setState(() => imageInfo = listener);
imageInfo.image.toByteData().then((ss) {
Uint8List lst = new Uint8List.view(ss.buffer);
ui.instantiateImageCodec(lst).then((val) {
val.getNextFrame().then((vaal) {
imagetoDraw = vaal.image;
});
});
});
});
});