loadImageFromAsset method

Future<Image> loadImageFromAsset(
  1. String assetPath
)

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;
}