getArchive function

Archive getArchive(
  1. Map<String, String> files
)

When you want to save it as any other Archive or want to implement own generation, you can get the Archive instance with all files added by calling getArchive with the files Map. Read the documentation of the archive package to see what you are able to do: https://pub.dev/documentation/archive

Implementation

Archive getArchive(Map<String, String> files) {
  final archive = Archive();
  files.forEach((name, content) {
    final rawData = utf8.encode(content);
    archive.addFile(ArchiveFile(name, rawData.length, rawData));
  });

  return archive;
}