Questions tagged [dart-isolates]

In the Dart programming language, an Isolate is a single-threaded unit of concurrency.

In the Dart programming language, an Isolate is a single-threaded unit of concurrency. Communication with others Isolates is done via message passing.

Introduktion to Dart Isolate

dart:isolate library

296 questions
0
votes
1 answer

Flutter UI is still freezing when using isolate

I am developing an application in Flutter where I need to implement an image selection function like in instagram. But there is an issue, my app UI is freezing when trying to get and compress files from user phone gallery. This is my first…
Aram
  • 1
0
votes
2 answers

How to stop playing a sound initiated in AlarmManager in Flutter

I'm currently writing an alarm clock app in Flutter and need to be able to start playing a custom sound at a specific time, even without the app currently running. I've already been able to achieve this with the following code (Using Android Alarm…
Sneex
  • 23
  • 5
0
votes
1 answer

Set a callback accessible from an isolate in flutter

I'm trying to achieve the following: I'm using a top level background handler for firebase notifications. However I would like to add an optional callback to the main app isolate. The objective is to trigger some UI refresh depending on the…
0
votes
0 answers

How to avoid the application stalling when loading a large widget in Flutter

I need to load a huge widget (built after a very wide number of loops) on a screen during (or before) the page load that will contain it. I managed to do it, but the process froze the whole application until its end. My goal is to show a spinning…
Rock
  • 1
  • 1
0
votes
1 answer

Illegal argument in isolate message: (object is a ReceivePort)

I was trying to write my own worker to process big amount of numbers. And decided to make always working Isolate in which all my data would be processed. class ProjectionWorker { ... Isolate? _isolate; ReceivePort? _workerPort; Stream?…
samir.a.ts
  • 17
  • 6
0
votes
1 answer

Flutter Isolate receives only the initial message

I'm trying to use an Isolate that will send a request, so as not to block the main thread/isolate. After using so, the function of the spawned Isolate is called only once, on the initial passed message. final isolate = await…
David Gomes
  • 650
  • 2
  • 10
  • 34
0
votes
0 answers

How to run Amplify's uploadFile function within a dart isolate?

My application has a function that allows to upload videos and other large files to Amazon S3 buckets via Amplify storage. The below function works as expected and uploads a file to my S3 bucket: Future uploadFile({File? file, String path…
Charles Van Damme
  • 765
  • 2
  • 6
  • 14
0
votes
1 answer

Flutter compute function not compiling

I have a repository class (check below) that calls APIs through the HttpService class. I'm receiving historical data that contains 1000s of data objects. To avoid the computation problem, I'm trying to implement the compute() function to move this…
Yashwardhan Pauranik
  • 5,370
  • 5
  • 42
  • 65
0
votes
2 answers

flutter_background_service not receiving updates

I'm using awesome_notifications and flutter_background_service in conjunction to update some app state when receiving data notifications from FirebaseMessaging. As noted in the awesome_notifications, the background message handler must be a…
0
votes
1 answer

Spawning Isolates in for loop and processing parallelly in Dart

for(int i=0;i<2;i++){ ..............preprocessing(pr)........... ..... = await someFunc(someData[i]) (this line spawns off new Isolate) ..............postprocessing(po).......... } I am writing this kind of function in dart and what I…
0
votes
1 answer

Add support for returning stream from an isolate

I have started using isolates and returned a value from my isolate as if it was a function. Then I wanted to change the code to return stream, instead of future. From this compute, List>( (params) async { ... return…
Guy Luz
  • 3,372
  • 20
  • 43
0
votes
1 answer

Can I use Async inside Dart Isolate ??? its not working

I am using ImageEditor package to merge different images. below is my code. its working perfectly fine without using Isolate, when i use it with isolate, i get null error. Working code without Isolate startEditing() async { for (var i = 0; i <…
Amanullah
  • 36
  • 2
0
votes
1 answer

What exactly is a ReceivePort / RawReceivePort? And how to find external method implementations in Dart?

I'm currently experimenting with Isolates in dart. I'm trying to create a wrapper around an Isolate to make it more pleasant to use. The desired interface is something along the lines: abstract class BgIsolateInterface { Future
Jelly Legend
  • 201
  • 1
  • 5
0
votes
1 answer

Dart: Store heavy object in an isolate and access its method from main isolate without reinstatiating it

is it possible in Dart to instantiate a class in an isolate, and then send message to this isolate to receive a return value from its methods (instead of spawning a new isolate and re instantiate the same class every time)? I have a class with a…
0
votes
1 answer

Type conversion error when trying to use Isolate.spawn()

I'm having a problem with Dart's generic types when using Isolate.spawn(). I feel this should work, but it doesn't. I'm trying to write a type-safe(-ish) wrapper around Isolate.spawn() that will ensure I'm passing valid types into the function I'd…
antonone
  • 2,045
  • 1
  • 25
  • 35