loadImageFromAsset method
Implementation
Future<Image> loadImageFromAsset(String assetPath) async {
final bytes = await rootBundle.load(assetPath);
final loadingCompleter = Completer<Image>();
decodeImageFromList(bytes.buffer.asUint8List(), (image) {
loadingCompleter.complete(image);
});
return loadingCompleter.future;
}