readPng function

Future readPng(
  1. String path
)

Reads a PNG file from the specified path and converts it to an Image object.

Parameters:

  • path: The file system path of the PNG to read

Returns a Future that completes with the loaded Image.

Implementation

Future<Image> readPng(String path) async {
  final bytes = await File(path).readAsBytes();
  return decodePng(bytes);
}