loadPathsFromAssets function

Future<List<VoyagerPath>> loadPathsFromAssets(
  1. String path, {
  2. AssetBundle? assetBundle,
})

loads voyager paths from yaml file in assets asynchronously where path is e.g. "assets/navigation.yml"

Implementation

Future<List<VoyagerPath>> loadPathsFromAssets(String path,
    {AssetBundle? assetBundle}) async {
  assetBundle ??= rootBundle;
  final yaml = await assetBundle.loadString(path);
  return loadPathsFromYamlSync(yaml);
}