Replace flutter_downloader with file_saver_ffi#104
Open
vanvixi wants to merge 1 commit intoNetShareOSS:masterfrom
Open
Replace flutter_downloader with file_saver_ffi#104vanvixi wants to merge 1 commit intoNetShareOSS:masterfrom
vanvixi wants to merge 1 commit intoNetShareOSS:masterfrom
Conversation
Member
huynguyennovem
left a comment
There was a problem hiding this comment.
Awsome. Thank you for doing this! Overall looks good to me, except two issues:
iosandmacosfile changes don't relate to this work. Could you please revert them and re-commit the change?- After downloading a file, it is no longer possible to open it (please watch the video). I printed the output path and saw that it is something like
content://media/external_primary/file/1000000232now, which seems to be exposed from thefile_saver_ffipackage, doesn't it? Previously, a file was downloaded and stored toAndroidPathProvider.downloadsPath. I also see it'sAndroidSaveLocation.downloadson Android by default in packagefile_saver_ffi. Not sure if these two paths are the same. Could you please check this?
Screen.Recording.2026-03-07.at.17.01.34.mov
huynguyennovem
requested changes
Mar 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace
flutter_downloaderwithfile_saver_ffifor cross-platform downloadsMotivation
flutter_downloaderworks well on Android/iOS, but its architecture adds significant complexity to the codebase:IsolateNameServerandReceivePortjust to receive download callbacks@pragma("vm:entry-point")static callback and manualIsolateNameServerregistration/cleanup ininitState/disposehttp-based implementation with no progress trackingloadTasksWithRawQueryAll of this makes
ClientWidgethard to understand and maintain.Solution
This PR replaces
flutter_downloaderwithfile_saver_ffi— a cross-platform file saving library that:Stream<SaveProgress>API — callers need zero knowledge of threading or platform internalsKey improvements:
httpimpl)SaveProgressUpdate(double progress)Changes
ClientWidget: RemovedReceivePort,IsolateNameServer,_initDownloadModule(),downloadCallback()static method, and 3 unused imports._downloadStreamListener()is unchanged.DownloadService: Replaced two platform-branched download methods with a singlestartDownloading()usingFileSaver.save(). MIME type detected automatically via the existingmimepackage.DownloadEntity: Removed unusedidandmannerfields; addedprogressfield andcopyWith().FileProvider: Added in-memory_progressMap+getProgress()for granular progress updates without polluting the Hive entity.FileTileClient: Progress indicator now shows determinate progress (0-100%) usingSelector<FileProvider, double>withshouldRebuildto avoid full-list rebuilds on every tick.download_manner.dart,uuiddependency, andandroid_path_provider.Result
The entire download flow — including real-time progress — now works identically on all platforms with significantly less code. Threading and chunk management are handled by
file_saver_ffiinternally; the app just listens to a stream.