Future<ui.Image> toImage({ double pixelRatio = 1.0 }) {
assert(!debugNeedsPaint);
final OffsetLayer offsetLayer = layer! as OffsetLayer;
return offsetLayer.toImage(Offset.zero & size, pixelRatio: pixelRatio);
}
I get an error? This is the error in the console package:flutter/src/rendering/proxy_box.dart': Failed assertion: line 3379 pos 12: '!debugNeedsPaint': is not true.
I've tried various things but it doesn't work.
You can try this way to do it. The problem with your code is that it is unable to re-render the Image with extension
.toImage(). I hope this would work.