Skip to content

Dispatch store action from an isolate callback? #172

@tonnyavery

Description

@tonnyavery

I am using flutter_downloader package to download some big files from the network in a nice manner.
When download task finishes library calls it's static download callback in a background isolate that is then uses ReceivePort to send a message to the main thread(isolate).

Problem is, all the code around this is now written in a singleton Manager class that is not a Widget.
When message that task download finished is published I need to somehow dispatch a store event that my download is finished so I could update UI properly.

How can I do that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions