addFile method Null safety

void addFile(
  1. ArchiveFile file
)

Add a file to the archive.

Implementation

void addFile(ArchiveFile file) {
  // Adding a file with the same path as one that's already in the archive
  // will replace the previous file.
  var index = _fileMap[file.name];
  if (index != null) {
    files[index] = file;
    return;
  }
  // No existing file was in the archive with the same path, add it to the
  // archive.
  files.add(file);
  _fileMap[file.name] = files.length - 1;
}