loadImageFromPath function
Implementation
Future<ui.Image> loadImageFromPath(String path, [bool cache = true]) async {
final file = cache
? await DefaultCacheManager().getSingleFile(path)
: File(path);
final bytes = await file.readAsBytes();
final codec = await ui.instantiateImageCodec(bytes, allowUpscaling: false);
return (await codec.getNextFrame()).image;
}