archive
archive copied to clipboard
Flutter web support
Can any one know me, how to use this plugin in flutter web? I want to compress list of image file in single zip file in flutter website.
Thumbin up! Package is awesome, badge on pub.dev is showing that this package is JS and web-supported, but running it in Chrome throws:
Unsupported: Platform._operatingSystem
@TejaDroid Please have a look into: https://github.com/brendan-duncan/archive/issues/33#issuecomment-284298364
I used the same to create and download a zip for flutter web.
NOTE: You have to use platform specific import. For example:
import 'package:archive/archive.dart' as web;
import 'package:archive/archive_io.dart' as io;
if(kIsWeb) {
web.Archive archive = web.Archive();
} else {
io.Archive archive = io.Archive();
}
Hey @AkshayNG you are lifesaver! Thanks for pointing out, I can confirim conditional imports working lika a charm.
@TejaDroid Please have a look into: #33 (comment)
I used the same to create and download a zip for flutter web.
NOTE: You have to use platform specific import. For example:
import 'package:archive/archive.dart' as web; import 'package:archive/archive_io.dart' as io; if(kIsWeb) { web.Archive archive = web.Archive(); } else { io.Archive archive = io.Archive(); }