Maksimka101 / isolate-bloc

A Flutter package that helps implement the BLoC pattern when blocs run in their own Isolate.
MIT License
21 stars 9 forks source link

Can we encode using flutter_ffmpeg inside an isolate-bloc? #3

Closed aytunch closed 3 years ago

aytunch commented 3 years ago

Encoding with flutter_ffmpeg takes too much time and resources and generates Jank in the UI. So it would be very nice if we could run it in an isolate thread. Can we do it with the help of your library? If yes, is there a way to get progress callbacks from the thread? I want to show the user how much encoding is done. Normally flutter_ffmpeg gives this callback in its API.

Also, is there a straightforward way to allow this isolate-bloc to keep on working while the app is in the background?

Maksimka101 commented 3 years ago

Hi. If you are using bloc for state management you may convert your bloc to the isolate bloc. Or may create an isolate bloc and do your job into it. However if you just want to convert image inside isolate you should use some libraries which helps you work with isolates or read something about them, they aren't so scary as you may think.

Maksimka101 commented 3 years ago

Unfortunately, only native services can works in background.