Fall back to global cache and platform if null when injected into constructor (#50370)

This commit is contained in:
Jenn Magder
2020-02-07 15:28:45 -08:00
committed by GitHub
parent ef74572e76
commit 082ae838bd
5 changed files with 168 additions and 77 deletions

View File

@@ -641,6 +641,13 @@ void checkFileNotExists(String file) {
}
}
/// Checks that the directory exists, otherwise throws a [FileSystemException].
void checkDirectoryExists(String directory) {
if (!exists(Directory(directory))) {
throw FileSystemException('Expected directory to exist.', directory);
}
}
/// Check that `collection` contains all entries in `values`.
void checkCollectionContains<T>(Iterable<T> values, Iterable<T> collection) {
for (final T value in values) {