asset_cache will load and cache any asset of type
T given a decoder.
CachingAssetBundle does not cache binary data, we
load and cache data
Binary resources (from load) are not cached.
Create a custom asset cache by inheriting from
AssetCache and pass it a decoder. Or
GenericCache and override
We include the following singletons for loading various asset types:
asset_cache to your
Describe assets in your
assets: - assets/images/ - assets/json/
AssetCache.basePath to avoid using full asset paths:
ImageAssets.instance.basePath = "assets/images/";
Load and cache assets using
load, which returns a
final image = await ImageAssets.instance.load('sprite.png')
Based on CachingAssetBundle.