load method

  1. @override
dynamic load(
  1. dynamic url,
  2. Function onLoad, [
  3. Function? onProgress,
  4. Function? onError,
])
override

Implementation

@override
load(url, onLoad, [onProgress, onError]) async {
  if (path != "" && url is String) {
    url = path + url;
  }

  url = manager.resolveURL(url);

  var cached = Cache.get(url);

  if (cached != null) {
    manager.itemStart(url);

    Future.delayed(Duration(milliseconds: 0), () {
      onLoad(cached);

      manager.itemEnd(url);
    });

    return cached;
  }

  final resp = await ImageLoaderLoader.loadImage(url, flipY);
  onLoad(resp);

  return resp;
}