Created
September 2, 2025 12:27
-
-
Save tunitowen/29964ff1fe13bc56d08c7d6ae1627533 to your computer and use it in GitHub Desktop.
Joii Isolate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dart:isolate'; | |
| import 'package:flutter/foundation.dart'; | |
| void main() async { | |
| final receivePort = ReceivePort(); | |
| receivePort.listen((value) { | |
| print("V: $value"); | |
| }); | |
| Isolate.spawn(doThing, receivePort.sendPort); | |
| } | |
| void doThing(SendPort sendPort) { | |
| final list = List.generate(100000, (e) => e); | |
| for (final v in list) { | |
| print(v); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment