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
0 answers

isolate is giving error in Stateful Widget in Flutter

I want to use dart isolates in Flutter. When I use it in a StatelessWidget it works fine, but when I change the widget to StatefulWidget, it gives me the following error: E/flutter ( 3154): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)]…
sm_sayedi
  • 326
  • 2
  • 17
0
votes
0 answers

Illegal argument in isolate message: (object extends NativeWrapper - Library:'dart:ui' Class: Path)

I am trying to use isolates to load a list of waypoint, around 20k of them, I tried it the normal way takes around 1 to 2 mins to load, so thought of trying isolates, never used them, This is the code i have come up with so far, Future
Pannam
  • 482
  • 1
  • 3
  • 16
0
votes
0 answers

Binding has not yet been initialized. when using isolates

I got this error while I am using isolates I am not able to use both compute function and Isolate.spawn function both gives the same error. I have also written WidgetsFlutterBinding.ensureInitialized(); in the main function but then also this error…
0
votes
0 answers

Flutter Isolates stops on background, also I am not receiving any response on receive port on my main thread

main Function void main() { initializeIsolate(); runApp(const MyApp()); } Future initializeIsolate() async { RootIsolateToken rootIsolateToken = RootIsolateToken.instance!; // final DatabaseService isolatedDbService =…
Sumit yadu
  • 53
  • 5
0
votes
0 answers

Dart/Flutter Isolates - communication with Provider

I have a _downloadInIsolate(List args) function that works in an isolate. I call it from the VideoDownloadScreen widget. In this widget, after the code responsible for creating and communicating with the isolate, I have the following code: …
tmp
  • 56
  • 5
0
votes
2 answers

Flutter Implementation of Isolates/compute inside stack of widgets - 'List>' can't be assigned to the parameter type 'List'

The argument type 'List' can't be assigned to the parameter type 'List' return SizedBox( width: screenSize.width, height: screenSize.height, child: Stack( alignment: Alignment.topLeft, children: listOfWidgets) ); listOfWidgets for example…
Rizwan Ahmed
  • 1,272
  • 2
  • 16
  • 27
0
votes
3 answers

Stream of millions of objects takes too much memory

I'm generating a load of coordinates (made of 3 numbers) within a geographical area. However, using Streams (which should be much more efficient than Lists), fills up the app's memory very quickly, as can be seen in this screenshot from…
JaffaKetchup
  • 1,151
  • 10
  • 26
0
votes
0 answers

Flutter: "Binding has not yet been initialized" when accessing Flutter Secure Storage from an isolate

I'm working on a large Flutter project for Android/iOS/Windows. It will have multiple processor-intensive code segments, such as server data syncing, so to prevent the UI from being slowed down we're running those on separate isolates. One of the…
0
votes
0 answers

How to sandbox an untrusted code in Dart?

I'm looking for a way to build a secure third-party extension system for a Flutter app. I know that it's possible to load Dart code at runtime using Isolate.spawnUri(), it will have an isolated memory, but it will still be able to access insecure,…
Gieted
  • 835
  • 6
  • 21
0
votes
1 answer

How is Dart Isolate implemented in Flutter for Android/ iOS?

I have a problem understanding Dart Isolates and how they are implemented in Flutter for Android/ iOS. This answer states that "Dart is compiled to native machine code (ARM, Intel, ...) executable and bundled with some native platform code (Java,…
maxmitz
  • 258
  • 1
  • 4
  • 17
0
votes
1 answer

Isolate with FutureBuilder not working in Flutter

I am trying to load a big file using FutureBuilder and isolates using below code. void main() async { WidgetsFlutterBinding.ensureInitialized(); runApp(const MyApp()); } // utils const fileName = 'assets/files/big_file.txt'; const…
Kikki
  • 496
  • 1
  • 10
  • 17
0
votes
1 answer

Why is Send port null

I want to update the UI when I receive background notification from Firebase. I have a backgroundMessage handler ` @pragma('vm:entry-point') Future handleBackgroundNotification(RemoteMessage remoteMessage) async { try { final SendPort…
0
votes
0 answers

UI freeze when make a large query in Floor flutter

My table have over 8000 records, when i search with common keyword, UI was freezed and can not do anything in screen. Do you have any suggestions for this issue. Dao: @Query( 'SELECT * FROM ${DataConstants.tableSchool} WHERE instr(name,…
Vũ Thao
  • 3
  • 2
0
votes
0 answers

About using variables in an Isolate with AlarmManager

I am trying to make an app sending a message using an isolate with AlarmManager. But I'm stuck. Below is the code. There's a button. When you press the button, it calls the function startAlarm. Again, it executes the function sendToIsolate.…
waterrock
  • 1
  • 1
0
votes
0 answers

Dart isolate messages delay

I am learning about isolates at the moment and I'm trying to get an example to send messages from the main isolate to the worker isolate and vice versa. I can currently get messages to flow in both directions but the messages coming from the worker…
mirkaim
  • 145
  • 1
  • 10