fluttercommunity / fluttercommunity/flutter_uploader

"result.listen" is not emitting the response object in flutter_downloader: ^1.5.2

Open
#141 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
218
Forks
172
PR merge metrics
No merged PRs in 30d

Description

I tried to use the package (version "1.5.2") in my application and everything is working file except the `result.listen()` method. It's not emitting any event for us to capture and process the response from the API.

Phone: "Oneplus 6"
OS: "Android 10"

code:

```dart
final flutterUploader = FlutterUploader();

final tokenId = await flutterUploader.enqueue(
url: 'https://example.com/post',

files: [
FileItem(
filename: 'name of file.ext',
savedDir: '/path/to',
fieldname: 'field',
)
],

method: UploadMethod.POST,

headers: {},

data: {},

showNotification: true,

tag: 'tag_name',
);

final subscription = flutterUploader.progress.listen((progress) {
log.print('progress.progress subscription', '${progress.progress}');
log.print('progress.status subscription', '${progress.status}');
});

final result = flutterUploader.result.listen((progress) {
log.print('progress.response result', '${progress.response}');
log.print('progress.status result', '${progress.status}');
log.print('progress.statusCode result', '${progress.statusCode}');
});
```

The `progress.listen` method is emitting event just fine while the `flutterUploader.result` event is silent even if the upload was 100 percentage completed.

What do we do?

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.