People who still buy music mostly get it as a ZIP. Bandcamp, Qobuz and most download shops hand you one archive per album. My offline music player, Clickwheel, could only import loose audio files, so the first thing a new user had to do was find an unzip tool on their phone. That is a bad first minute.
So I added ZIP import. The diff was 469 lines across 13 files, and almost none of it was "call the unzip function". Here is what the rest was.
1. Stream from disk, off the UI thread
A FLAC album is easily several hundred megabytes. Reading it into a Uint8List on a phone is asking for an out-of-memory kill. The archive package (4.x) can decode from a file stream and write each entry straight to disk:
static List < String > unpackZip ( String zipPath , String destPath ) { final input = InputFileStream ( zipPath ) ; final written = < String > [ ] ; try { final archive = ZipDecoder ( ) . decodeStream ( input ) ; for ( final entry in archive ) { if ( ! entry .…