imageFromFilePath function
Implementation
Future<ui.Image> imageFromFilePath(String filePath) async {
var byteData = await rootBundle.load(filePath);
Uint8List lst = Uint8List.view(byteData.buffer);
var codec = await ui.instantiateImageCodec(lst);
var nextFrame = await codec.getNextFrame();
return nextFrame.image;
}