How can I convert an Icon to an Image

Just found a code snippet which might help if you want to wrap those misbehaving LAF provided icons more often: /** * Some ui-icons misbehave in that they unconditionally class-cast to the * component type they are mostly painted on. Consequently they blow up if * we are trying to paint them anywhere else (f.i. … Read more

Flutter: How would one save a Canvas/CustomPainter to an image file?

You can capture the output of a CustomPainter with PictureRecorder. Pass your PictureRecorder instance to the constructor for your Canvas. The Picture returned by PictureRecorder.endRecording can then be converted to an Image with Picture.toImage. Finally, extract the image bytes using Image.toByteData. Here’s an example: https://github.com/rxlabz/flutter_canvas_to_image