writePng function

Future<void> writePng(
  1. String path,
  2. dynamic image
)

Writes an Image object to a PNG file at the specified path.

Parameters:

  • path: The file system path where the PNG should be saved
  • image: The Image object to be written

Implementation

Future<void> writePng(String path, Image image) async {
  File(path).writeAsBytes(await encodePng(image));
}