fromAsset static method
Future<SkeletonDrawable>
fromAsset(
- String atlasFile,
- String skeletonFile, {
- AssetBundle? bundle,
Constructs a new skeleton drawable from the atlasFile
and skeletonFile
from the root asset bundle
or the optionally provided bundle
.
Throws an exception in case the data could not be loaded.
Implementation
static Future<SkeletonDrawable> fromAsset(String atlasFile, String skeletonFile, {AssetBundle? bundle}) async {
bundle ??= rootBundle;
var atlas = await Atlas.fromAsset(atlasFile, bundle: bundle);
var skeletonData = await SkeletonData.fromAsset(atlas, skeletonFile, bundle: bundle);
return SkeletonDrawable(atlas, skeletonData, true);
}