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

Unit-testing function with isolates and compute in flutter

I'm trying to test a widget that receives and displays some data. This widget uses a controller. In the constructor I start receiving data, after which I execute the parser in a separate isolate. During the tests, the function passed to the compute…
rulila52
  • 111
  • 1
  • 6
2
votes
0 answers

How to play audio from an isolate?

The requirement is simple: An app (for both mobile and desktop) that continues to run in background and periodically plays some audio and/or vibrates if some events happen. An isolate seemed to be the obvious choice. Problem is, as soon as the…
SePröbläm
  • 5,142
  • 6
  • 31
  • 45
2
votes
1 answer

Catching Exceptions from Dart Isolates

I'm having trouble working out how I can catch exceptions from isolates. With the following code, I've tried everything I can think of to handle the error that is thrown from task, but it's still marked as Unhandled exception. void main() async { …
テッド
  • 776
  • 9
  • 21
2
votes
1 answer

Why doesn't readLineSync works in an Isolate

void func(String dummy) { String? name = stdin.readLineSync(); print(name); } void main(List args) { Isolate.spawn(func, "Testing"); } Why doesn't my program prompts a user input ..and waits for me to enter it. Instead, it simply…
Avan
  • 366
  • 3
  • 17
2
votes
1 answer

How to make multiple subscription on one ReceivePort dart

I have a task of creating N - isolates, and one main ReceivePort which will be passed to these isolates, and by using this ReceivePort I am passing all of the information which is needed by function to give me a desirable output. It works for the…
2
votes
1 answer

Flutter Isolate Issue with Platform Channel code

I tried to clear my app notification count using the platform code. And I try to implement isolate for this function in dart side. I got the above error message to both compute and isolate ways. Both are failed. Error Exception: Null check operator…
BIS Tech
  • 17,000
  • 12
  • 99
  • 148
2
votes
0 answers

Registering Flutter plugins in iOS

I'm using hive and path provider on different isolate, when I try to access them I'm getting MissingPluginException, I'm trying to register these plugins manually but not sure how to do it. Can anyone help me in solving the issue Thank's in advance,
Varun
  • 1,658
  • 1
  • 7
  • 11
2
votes
2 answers

How to get full stack trace of Dart Isolate error

I'm having problems to build a Flutter app in an Android device. The error bellow happens whenever I try to override current version, downloaded from Google Play Store, with new debug version. But it is very hard to find where the problem is,…
lbodevan
  • 123
  • 1
  • 1
  • 9
2
votes
1 answer

Flutter compute function takes time to start execute

I am trying to use Flutters compute function to do some real time heavy image processing using a C++ code and dart ffi. I tried wrapping the call to the heavy function in a compute to avoid messing with the ui thread and I took some time…
2
votes
0 answers

Running Palette Generator (by flutter team) inside an async function freezes the app for a bit

I was trying to use the palette generator plugin by flutter team. However, when I run the function, the UI freezes for two seconds or three. Here is how im trying to use it: void _generateColorPalette(BuildContext context) async { try { if…
dev404
  • 1,047
  • 8
  • 21
2
votes
1 answer

Dart Isolate as permanent worker

I'm using Flutter and need to do some parsing. To prevent said parsing from blocking the UI, I'm using an Isolate ; however spawning the Isolate seems to have a big time cost (~2s on my Samsung A5, with the 'compute' fonction). Which is a bit…
ouai
  • 150
  • 1
  • 10
2
votes
3 answers

Keep websocket connection alive Flutter

I've been running through this for along time and i'm still stuck. I'm working on a chat app using Flutter/Dart that it's based on Websocket . I would like to keep the state of a connected user alive even if he terminates the app. At this moment…
2
votes
1 answer

Is it possible to play a sound from android alarm manager's callback in the background?

I am trying to create a basic alarm app which plays a sound at the given time. For this, I am using the android_alarm_manager plugin. To play the sound, I am using the flutter_ringtone_player plugin main(List args) async { …
Kranthi S
  • 125
  • 1
  • 5
2
votes
2 answers

Flutter simultaneous images upload

I need to upload a list of images into a storage, but I don't want to upload and await for every single image after the other, because it takes quite some time. I would like to upload them simultaneously, like in different threads. There is a way to…
Slaine06
  • 85
  • 2
  • 8
2
votes
1 answer

Flutter Unhandled exception: ServicesBinding.defaultBinaryMessenger was accessed before the binding was initialized

I am trying to create an Isolate un Flutter and then use this isolate to fetch some data from Firebase Realtime Database. I am creating de Isolate in a file called home.dart (not main) and here is my code for that file. I have a class to create the…