I am trying to make an installer, where I download a zip file from a source and extract it to a specific path.
The only package that works with windows applications is the archive package, please note that only archive_io version works with applications, and the archive version only works for web apps(if you intend to read the documentation).
My problem is that I am trying to update the UI with a percentage of the extraction progress, however nothing I tried seems to work, setting the return type of my function to a stream will make the function in its entirety stops working, setting it to a future, will freeze the UI until the whole function completes.
Also, I am trying to make it work for big files, and using the readAsBytes() function will break my application without throwing any exceptions, even if the file is as small as 200MB.
_extractFileClean() async {
// path to compressed file
String path = "C:\\Users\\myUser\\Desktop\\compressedFile.zip";
// getting file & directory
File file = File(path);
Directory directory = file.parent;
final inputStream = InputFileStream(path);
var archive = ZipDecoder().decodeBuffer(inputStream);
// extract the files to parent of the compressed file itself
extractArchiveToDisk(archive, directory.path);
}