插件 archive https://pub.dev/packages/archive 使用此插件,您可以像这样操作: final archive = ZipDecoder().decodeBytes( _file, verify: true, password: "your_password", )
您可以使用此未发布的插件flutter_zip_archive,只需下载代码并使用即可。为了更好的未来开发,请将存储库中的方法通道与lib文件夹中包含的文件添加到您的应用程序中。 此软件包支持使用密码压缩和解压缩文件。它还提供了添加zip文件应存储的目标的特权。 附注:要加密文件,您需要在压缩之前本地可用的文件。
ZipEncoder
- pskinkZipDecoder
支持密码,而ZipEncoder
却不支持;-( - pskinkarchive
支持,参见https://github.com/brendan-duncan/archive/issues/95。https://dev59.com/7cHqa4cB1Zd3GeqP-e-Z#69072762是一个错误的答案。 - Ben Butterworth