zipDirectory method Null safety
Implementation
void zipDirectory(Directory dir,
{String? filename,
int? level,
bool followLinks = true,
DateTime? modified}) {
final dirPath = dir.path;
final zipPath = filename ?? '$dirPath.zip';
level ??= GZIP;
create(zipPath, level: level, modified: modified);
addDirectory(dir,
includeDirName: false, level: level, followLinks: followLinks);
close();
}