fromAsset static method

Future<SkeletonData> fromAsset(
  1. Atlas atlas,
  2. String skeletonFile, {
  3. AssetBundle? bundle,
})

Implementation

static Future<SkeletonData> fromAsset(Atlas atlas, String skeletonFile, {AssetBundle? bundle}) async {
  bundle ??= rootBundle;
  if (skeletonFile.endsWith(".json")) {
    return fromJson(atlas, await bundle.loadString(skeletonFile));
  } else {
    return fromBinary(atlas, (await bundle.load(skeletonFile)).buffer.asUint8List());
  }
}