find static method

Future<List<String>> find(
  1. AssetIndex index,
  2. String path
)

The files that mention path: for a file, its whole path; for a folder, any path under it — the folder's own files included, which name each other by path too.

Implementation

static Future<List<String>> find(AssetIndex index, String path) async {
  final folder = FileSystemEntity.isDirectorySync(index.absolute(path));
  final out = <String>[];
  for (final file in await _candidates(index)) {
    if (file == path) continue;
    final kind = _kindOf(file);
    if (kind == null) continue;
    final text = await _read(index, file);
    if (text == null) continue;
    if (_edit(kind, text, file, file, path, path, folder).$2) {
      out.add(file);
    }
  }
  return out;
}