readAssetDir static method

Future<AssetList?> readAssetDir(
  1. Lib lib,
  2. SharedOptions options
)

Implementation

static Future<AssetList?> readAssetDir(Lib lib, SharedOptions options) async {
  if (options.assetPaths.isEmpty) return null;

  final AssetList list = AssetList(
    lib: lib,
    options: options,
  );

  final List<String> paths = await options.findAssetPaths;
  await Future.wait(
    paths.map((String path) async {
      await list.add(path, nowWrite: false);
    })
  );

  return list;
}