fluttercommunity / fluttercommunity/flutter_downloader

File download no response.

Open
#254 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
940
Forks
561
Avg merge
1h 18m
Merged PRs (30d)
1

Description

I followed the instructions on https://pub.dev/packages/flutter_downloader#-readme-tab- and https://github.com/fluttercommunity/flutter_downloader/blob/master/example/lib/main.dart, installed `flutter_downloader: ^1.4.1`,
modified android\app\src\main\AndroidManifest.xml as the following.

android\app\src\main\AndroidManifest.xml

```




















```

modified main.dart like the following.
```
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await FlutterDownloader.initialize();

runApp(new MyApp());
}
```
And In a onPress callback I wrote code like the following.
```
onPressed: () async {
// Downloader.download(fileUrl, fileName, '.$fileType');
var _saveDir = await _findLocalPath(context);
final taskId = await FlutterDownloader.enqueue(
url: fileUrl,
savedDir: _saveDir,
showNotification:
true, // show download progress in status bar (for Android)
openFileFromNotification:
true, // click on notification to open downloaded file (for Android)
);
print('_saveDir: $_saveDir, taskId: $taskId');
final tasks = await FlutterDownloader.loadTasks();
print('tasks: $tasks');
Navigator.of(context).pop();
},
```
However no error info printed, from the debug console log, I can only see the DownloadTask is always enqueue status, I have tried almost everything I can, but it seems the same result, no notification, no other log info.

```
I/flutter ( 6509): Download task is enqueued with id(d8463edf-ca00-42f4-8b89-417bc8157f93)
I/flutter ( 6509): _saveDir: /storage/emulated/0/Android/data/com.example.jeecgboot_app/files/Download, taskId: d8463edf-ca00-42f4-8b89-417bc8157f93
I/flutter ( 6509): tasks: [DownloadTask(taskId: 3ca10fa1-41b4-4296-b521-93fc6626f789, status: DownloadTaskStatus(1), progress: 0, url: http://192.168.1.96:3000/jeecg-boot/sys/common/static/mementopython3-english_1583207294984.pdf, filename: null, savedDir: /storage/emulated/0/Android/data/com.example.jeecgboot_app/files/Download), DownloadTask(taskId: d8463edf-ca00-42f4-8b89-417bc8157f93, status: DownloadTaskStatus(1), progress: 0, url: http://192.168.1.96:3000/jeecg-boot/sys/common/static/IPAccessHandler-fix_1583205752923.txt, filename: null, savedDir: /storage/emulated/0/Android/data/com.example.jeecgboot_app/files/Download)]
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with android/app/src/main/AndroidManifest.xml and main.dart, then trace the FlutterDownloader.initialize and FlutterDownloader.enqueue entry points against the logged DownloadTask state and the example/lib/main.dart configuration. Reproduce the HTTP download and verify that the task progresses beyond enqueued, produces a notification, and is available in the requested saved directory.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, dart, kotlin
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.