Isolates won't work on dart pad , you should use a local environment.
Spawning isolates
import'dart:isolate';voidmain() {// isolatesIsolate.spawn(entryFunction, "This is a message from the main isolate");print("Inside Main Isolate");}voidentryFunction(message) {print(message);}
import'dart:isolate';voidmain() async {// isolatesIsolate i1 =awaitIsolate.spawn( entryFunction, "This is a message from the main isolate");print("Inside Main Isolate");}voidentryFunction(message) {print(message);}
A single isolate running it's own event loop
Each isolate has their own segment of memory
The "entryFunction" has to be a top level function(i.e. not any function inside class or interface or something like that) or a static function
In Flutter you can use "compute" method which handles a lot the things for you and it's much easier to implement
This section gives you a basic idea about how to work with isolates . But you can imagine how complicated it will get if you need to manage multiple isolates . You should write a separate class that will help deal with this efficiently . Or use some high level package from pub.dev