Skip to content

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

Open
@ganeshrvel

Description

@ganeshrvel

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:

      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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions