findAssets method

  1. @override
Stream<AssetId> findAssets(
  1. Glob glob,
  2. {String? package}
)

Returns all readable assets matching glob under the current package.

Implementation

@override
Stream<AssetId> findAssets(Glob glob, {String? package}) {
  package ??= rootPackage;
  if (package == null) {
    throw UnsupportedError(
        'Root package is required to use findAssets without providing an '
        'explicit package.');
  }
  return Stream.fromIterable(assets.keys
      .where((id) => id.package == package && glob.matches(id.path)));
}