Issue made a simple counter app with shake package to increment counter var by shaking phone, things works well when app is running in front (in active state) but opening other app stops this shake feature after one minute, it
Continue readingTag: dart-isolates
Type conversion error when trying to use Isolate.spawn()
Issue 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
Continue readingWhy doesn't readLineSync works in an Isolate
Issue void func(String dummy) { String? name = stdin.readLineSync(); print(name); } void main(List<String> args) { Isolate.spawn(func, "Testing"); } Why doesn’t my program prompts a user input ..and waits for me to enter it. Instead, it simply exits. Can someone help
Continue readingIn Flutter, how do we use Firebase Messaging onBackgroundMessage to create a notification, using flutter_local_notifications?
Issue We are working on an encrypted chat application where we use Firebase Messaging for data notifications. Some client-side logic needs to be done upon receiving a data notification, before showing an actual notification to the user. For example, a
Continue readingHow can I get multiple messages from dart isolate?
Issue How can I get multiple messages from dart isolate? I’m trying to create an excel file and want to do some operation on that file in an isolate. Before doing an operation on that file, I want to return
Continue readingIs Dart really a single-threaded programming language?
Issue I’m very new to Dart and stilling learning it. As I understand, Dart executes code in different isolates. An isolate could start up another isolate to execute some long-running code. For each isolate, there is a thread and some
Continue readingDart program not exiting
Issue I’m having trouble tracking down why my dart program isn’t terminating. I’m pretty sure it’s something to do with either isolates, or stream controllers, and making sure they are closed, but I can’t work out what the problem is.
Continue readingCatching Exceptions from Dart Isolates
Issue 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.
Continue readingHow to pass arguments (besides SendPort) to a spawned isolate in Dart
Issue In this article, they spawned an isolate like this: import ‘dart:isolate’; void main() async { final receivePort = ReceivePort(); final isolate = await Isolate.spawn( downloadAndCompressTheInternet, receivePort.sendPort, ); receivePort.listen((message) { print(message); receivePort.close(); isolate.kill(); }); } void downloadAndCompressTheInternet(SendPort sendPort) { sendPort.send(42);
Continue readingDart- Isolates are very slow when working with lists
Issue I want to generate a list of 300 items from a String however when this task is divided into 3 isolates,where each isolate is generating a list of 100 items it takes just as long as it would take
Continue reading