locate method

Future<File?> locate({
  1. Iterable<File> alsoCheck = const [],
})

The first verified copy of the model: the cache's own, then each of alsoCheck in order, such as the model an installed Wayfinder bundle ships. Returns null when none matches the pinned size and SHA-256.

It reads files only and never touches the network.

Implementation

Future<File?> locate({Iterable<File> alsoCheck = const []}) async {
  for (final file in [target.file, ...alsoCheck]) {
    if (await _matches(file)) return file;
  }
  return null;
}