fluttercommunity / fluttercommunity/flutter_downloader

Swift Conversion Discussion

Open
#693 18 comments 0 reactions 1 assignee Claimed by @Hackmodford View on GitHub
Dominant language
Kotlin
Stars
940
Forks
561
Avg merge
1h 18m
Merged PRs (30d)
1

Description

I am in the process of converting the iOS plugin to Swift.

As part of this process there's a couple proposals I would like to make.

1) Move the database implementation to Dart. Potentially using Hive instead of sql.
So far this is significantly simplifying the codebase. One side-effect of this is removing the raw query method. Instead we could just provide the Hive box of download tasks.
At a later date the Android side could be converted to use the same Hive database. In the end there is less code to maintain.

2) Remove taskId from the Hive DownloadTask object model. Instead use id and rely on the platform's identifier.
Side effect of this is that I don't believe you can "update" the id of an existing object model. Instead the model must be deleted and a new model created. I'm not sure if this will cause problems. At the very least I can provide the new id.

3) Watching for task updates becomes simpler because we simply need to watch the Hive box for events. It looks like we could expose a stream of data for a single task or even the list of tasks.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.