generateImageFileWithPath method
void
generateImageFileWithPath()
If path is a directory, add the directory to dirList
.
If not, add it to imageSet
.
Implementation
void generateImageFileWithPath(
String path,
Set<String> imageSet,
List<Directory> dirList,
bool rootPath,
) {
final String fullPath = _getAbsolutePath(path);
if (FileSystemEntity.isDirectorySync(fullPath)) {
if (!rootPath) {
return;
}
final Directory directory = Directory(fullPath);
dirList.add(directory);
final List<FileSystemEntity> entries = directory.listSync(
recursive: false,
);
for (final FileSystemEntity entity in entries) {
generateImageFileWithPath(entity.path, imageSet, dirList, false);
}
} else if (FileSystemEntity.isFileSync(fullPath)) {
if (platformExcludeFiles.contains(basename(fullPath))) {
return;
}
final String relativePath = path
.replaceAll('$projectRootPath$separator', '')
.replaceAll('$projectRootPath/', '');
if (!imageSet.contains(path)) {
imageSet.add(relativePath);
}
}
}