fluttercommunity / fluttercommunity/flutter_downloader
Question about _tasks in example
- Dominant language
- Kotlin
- Stars
- 940
- Forks
- 561
- Avg merge
- 1h 18m
- Merged PRs (30d)
- 1
Description
Hi hnvn ,
if I change _tasks to static
```
static List<_TaskInfo> _tasks;
```
and then in downloadCallback want to print _tasks , like what we have in _bindBackgroundIsolate
```
static Future downloadCallback(
String taskId, DownloadTaskStatus status, int progress) async {
if (status == DownloadTaskStatus.complete) {
print(_tasks.toString());
}
print(
'Background Isolate Callback: task ($taskId) is in status ($status) and process ($progress)',
);
final SendPort send =
IsolateNameServer.lookupPortByName('downloader_send_port');
send.send([taskId, status, progress]);
}
```
the debug console will print a strange thing
```
6
```
we can retrive it in _bindBackgroundIsolate.
I have to do this because I cant't get file_name into downloadCallback
and I have to get file_name ,
what can I do to get fileName in downloadCallback because after finish the process I have to get sth from server and insert them into my DataBase ?
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading the example code around _tasks, downloadCallback, and _bindBackgroundIsolate, focusing on how the SendPort message is assembled and received. Determine whether file_name can be made available to downloadCallback, then verify that the resulting value can support the reported server and DataBase follow-up after completion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, flutter
- Domain
- mobile
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100