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
6
votes
1 answer

Dart, how to parse user string into functional dart code?

is it possible to parse in a user entered string, say from a text area, and then incorporate it into a dart function which you can then run, without having to post it back to the server? I guess I'm looking for a dart eval equivalent.
Daniel Robinson
  • 13,806
  • 18
  • 64
  • 112
6
votes
1 answer

Debugging isolates

I have failed to debug isolates. I.e. the debugger does not stop on breakpoints in isolates. I assume that this is not supported at the moment and my question are. 1) Am I right in that debugging isolates are not yet supported? 2) If so, are there…
Gunnar Eketrapp
  • 2,009
  • 1
  • 19
  • 33
6
votes
4 answers

Dart Isolates As Workers

Edited to make the question more clear. I am trying to work with Isolates (or Web Workers) in Dart. The only ways I can find to communicate between the main and isolate threads are send and call & then from the main thread. But that's a nice way for…
Pijusn
  • 11,025
  • 7
  • 57
  • 76
5
votes
3 answers

Is it possible to only convert a dart function to javascript

I am currently using the following package where the readme illustrates the following final bool loaded = await JsIsolatedWorker().importScripts(['test.js']); I am using the isolate worker package so my code can work on web and outside of web. I…
anonymous-dev
  • 2,897
  • 9
  • 48
  • 112
5
votes
1 answer

Flutter: Cannot use this MethodChannel before the binary messenger has been initialized when running a function using isolates

I'm trying to use isolates in my Flutter app with Bloc as a state management solution. Right now, I'm running into an error when running a particular function in wallet_list.dart. // wallet_list.dart final FlutterSecureStorage _storage = const…
neil_ruaro
  • 368
  • 3
  • 15
5
votes
1 answer

Invalid argument(s): Illegal argument in isolate message: (object is aReceivePort)

I am not sure if I am doing anything wrong in this code but I am clearly passing a SendPort when spawning a new isolate, however when I call: Infrastructure.instance.initialize(); I get following exception: Invalid argument(s): Illegal argument in…
AKornich
  • 682
  • 5
  • 16
5
votes
2 answers

How can I update the UI widget when Hive data get update inside onBackgroundMessage handler of FireBaseMessage in flutter?

I'm working on an app that receives notifications from firebase cloud messaging. I save the message in Hive upon receipt. I have a notification screen that displays the notification read from hive which updates immediately when notification is…
5
votes
1 answer

Flutter: MissingPluginException when calling plugin from isolate spawned by native code

I'm building a Flutter app that will have the capability to execute some actions when the device connects to another bluetooth device. This app should work on Android and iOS but for the sake of simplicity I'll focus on Android in this post. Also,…
Valentin
  • 5,379
  • 7
  • 36
  • 50
5
votes
3 answers

Flutter Parallel Network call

I am new in flutter. I need to call 5 API network calls in a single screen. It is taking very long time while i am using Async/await. How can we execute it on separate threads parallelly using isolate or anything else like it?
abdulec90
  • 262
  • 3
  • 11
5
votes
0 answers

Firestore listener inside a separate Isolate

I have a separate isolate which listens to a cloud-firestore document via stream snapshot. For this, I use isolate_handler package which works well. So to use cloud-firestore inside the isolate, await Firebase.initializeApp() is required which…
Darshan
  • 4,020
  • 2
  • 18
  • 49
5
votes
1 answer

Flutter & Dart: What is the correct way to manage obtained data from a computation made in an Isolate?

When doing expensive computations in Dart it is highly recommended to start up additional isolates. I know that, since isolates don't share any state, if you want to create communication between them, there is the possibility to pass a message from…
Iván Yoed
  • 3,878
  • 31
  • 44
5
votes
2 answers

How to pass native void pointers to a Dart Isolate - without copying?

I am working on exposing an audio library (C library) for Dart. To trigger the audio engine, it requires a few initializations steps (non blocking for UI), then audio processing is triggered with a perform function, which is blocking (audio…
Philiste
  • 161
  • 13
5
votes
0 answers

Platform location permission error with Flutter isolates

I'm attempting to run location updates on a Flutter isolate thread, the error is only present when running an isolate. Location requests works without issues on the main thread. The goal here is to run this as a background service, working with dart…
nplus
  • 51
  • 4
5
votes
0 answers

Flutter Isolate image manipulation Memory Issue

i'm working on a flutter app, which displays a lot of images of unknown aspect-ratio in a list (among other things) to improve the UX a row with an image displays the original image with a blurred version of it in the background (in a stack). To…
woelliJ
  • 1,494
  • 9
  • 17
5
votes
1 answer

Dart Isolates' pause function not working as expected

I've been playing around with Dart Isolates and have run into a problem using the isolate.pause(); function. import 'dart:io'; import 'dart:isolate'; main(){ ReceivePort receivePort = new ReceivePort(); Isolate.spawn(isolateEntryPoint,…
Mike Dane
  • 115
  • 2
  • 9
1 2
3
19 20