FileAssetLoader class
An AssetLoader that reads SVG fragment files from the local filesystem.
For pure-Dart (non-Flutter) programs where dart:io is available.
Use FileAssetLoader.defaultForPackage to automatically resolve the
avatar_builder_core asset directory:
final loader = await FileAssetLoader.defaultForPackage();
final svg = await avatar.toSvg(loadAsset: loader.load);
Or construct with an explicit directory path:
final loader = FileAssetLoader('path/to/assets');
Constructors
- FileAssetLoader(String assetsDir)
-
Creates a loader that reads assets from
assetsDir.
Properties
Methods
-
load(
String key) → Future< String> - Loads an SVG fragment by its bare asset key.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
defaultForPackage(
) → Future< FileAssetLoader> -
Creates a loader that resolves the
avatar_builder_corepackage's built-in asset directory automatically.