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

Passing Isolate/ControlPort through MethodChannel

Within our flutter app we are doing some background processing. For that, we need to create new flutter isolate in our native code so we can run code when activity is not open, based on this guide:…
Matej Drobnič
  • 981
  • 10
  • 18
0
votes
1 answer

Flutter Background Processes Using Android Alarm Manager and Isolates

I'm trying to get a timer (down to the hundredths of seconds) to work in Flutter even when the app is closed. I initially tried to use isolates as I thought they would work yet after testing with a Pixel 4 running Android 11 I found that it was…
Samuel Drescher
  • 457
  • 1
  • 3
  • 13
0
votes
0 answers

In dart how to let an isolate create instance of child class Object from different package?

I have a isolate which needs ClassParent kind of object. This isolate resides in PackageA. I have another PackageB, which implements this in ClassChild. Now I want my isolate to pick up instances of ClassParent kind at runtime, that too such…
user3769778
  • 967
  • 2
  • 7
  • 26
0
votes
1 answer

Isolate Unhandled exception: E/flutter call the `WidgetsFlutterBinding.ensureInitialized()`

I am using this library(photo_manager) to load images from the device. However loading a lot of images causes Flutter to skip frames so I decided to put the code inside an Isolate. When I run the following code outside the isolate it runs without…
unbalanced_equation
  • 839
  • 2
  • 8
  • 21
0
votes
0 answers

special case of ServicesBinding.defaultBinaryMessenger was accessed before the binding was initialized

I'm running a method inside the initState() of my Flutter app that perform oneSignal initialization part of this method is sending tags of the user to the OneSignal Api but according to their documentations they said that this method of sending tags…
Karrar
  • 1,273
  • 3
  • 14
  • 30
0
votes
1 answer

Using compute to read large data from json file in flutter

I am trying to read a lot of data from a JSON file in flutter. The data retrieval results in jank so I decided to use compute but then it didn't return any results. This is my code with compute that does not return data: Future>…
ASAD HAMEED
  • 2,296
  • 1
  • 20
  • 36
0
votes
2 answers

MissingPluginException(No implementation found for method DocumentReference) on Send data to firestore from flutter isolate

I'm trying to make a background location tracking application in Flutter. So I create an isolate for running background service. its working well if I store location data in local file system from isolate. but when I connect Firebase for sending…
0
votes
2 answers

Flutter: Unable to execute database CRUD inside dart Isolate

I am trying to do data syncing from server in separate dart isolate/compute and also need to dump downloaded data to database using SQFlite but I am getting error that I can't figure out what was gone wrong. here is the code import…
dinesh.rajbhar
  • 191
  • 1
  • 1
  • 5
0
votes
1 answer

How to understand isolate in Flutter? like Thread ? like Process?

Isolate is like a thread in Java, but the memory is not shared, also like a Linux process, but the function is more like Thread,how to understand it ?
Chunsheng Wei
  • 881
  • 2
  • 7
  • 8
0
votes
0 answers

how to use isolates with a whole class not just a starting point function

I want to create a second thread to host and multiple functions as well as to accept and output messages and data. I tried googling a lot but most examples are either straight copy paste of each other or very low level tutorials.
Kaki Master Of Time
  • 1,428
  • 1
  • 21
  • 39
0
votes
2 answers

Flutter compute function not called if parameter is not a primitive?

I tried to send a Map to a compute, but computer is never called. The strange point is if I replace Map with int, it works: void A() { var map=Map(); map["p1"]=90; D("before compute"); var r1 = await compute(p1, 10); D("after…
AVEbrahimi
  • 17,993
  • 23
  • 107
  • 210
0
votes
0 answers

does the isolate's port send message use the socket?

The different isolate communicate with each other by the port, does the port is the socket's port, use the socket send and receive message from each other?
ping.wu
  • 31
  • 3
0
votes
1 answer

When exactly does a Dart program terminate?

I was wondering when exactly a Dart program terminates. Take the following program: import 'dart:isolate'; Future calculateTheAnswer(SendPort port) async { await Future.delayed(Duration(seconds: 1)); port.send(42); } void main() async { …
Marcel
  • 8,831
  • 4
  • 39
  • 50
0
votes
2 answers

How to close receivePort to get .toList() method working?

I am trying to get answer from Isolate as list. I wrote next code. The problem That it's not working. It's simply wait. main() async { ReceivePort receivePort = ReceivePort(); Isolate.spawn(echo, receivePort.sendPort); var d = await…
Dmitry Bubnenkov
  • 9,415
  • 19
  • 85
  • 145
0
votes
1 answer

What difference between await for(var msg in receivePort) and receivePort.listen()?

I am learning Dart: main() async { ReceivePort receivePort = ReceivePort(); Isolate.spawn(echo, receivePort.sendPort); // await for(var msg in receivePort) // { // print(msg); // } receivePort.listen((msg) { print(msg);} );…
Dmitry Bubnenkov
  • 9,415
  • 19
  • 85
  • 145
1 2 3
19
20