addFile method
Implementation
Future<void> addFile(File file, [String? filename, int? level = gzip]) async {
final fileStream = InputFileStream(file.path);
final archiveFile =
ArchiveFile.stream(filename ?? path.basename(file.path), fileStream);
if (level == store) {
archiveFile.compression = CompressionType.none;
}
archiveFile.lastModTime =
(await file.lastModified()).millisecondsSinceEpoch ~/ 1000;
archiveFile.mode = (await file.stat()).mode;
_encoder.add(archiveFile);
await fileStream.close();
}