asset static method
Future<File?>
asset(
- String bundleKey, {
- required Factory riveFactory,
- AssetBundle? bundle,
- AssetLoaderCallback? assetLoader,
Imports a Rive file from an asset bundle.
Implementation
static Future<File?> asset(
String bundleKey, {
required Factory riveFactory,
AssetBundle? bundle,
AssetLoaderCallback? assetLoader,
}) async {
final bytes = await (bundle ?? rootBundle).load(
bundleKey,
);
final file = await decode(
bytes.buffer.asUint8List(),
riveFactory: riveFactory,
assetLoader: assetLoader,
);
return file;
}