load static method
Implementation
static Future<ui.Image> load(String asset, Size size) async {
ByteData data = await rootBundle.load(asset);
ui.Codec codec = await ui.instantiateImageCodec(
data.buffer.asUint8List(),
targetWidth: size.width.toInt(),
targetHeight: size.height.toInt(),
);
ui.FrameInfo fi = await codec.getNextFrame();
return fi.image;
}