I'm trying to use Isolates in Dart. The tutorials from dartlang.org seem to use the function spawnFunction
. But that does not seem to work for me. And I cant find any docs about this.
import 'dart:isolate';
void doThing() {
print('Hello!');
}
main() {
spawnFunction(doThing);
}
.
Unhandled exception:
No top-level method 'spawnFunction' declared.
The docs from api.dartlang.org mention Isolate.spawn
but I get an error saying there is no static method spawn
declared.
Did I miss something? A link to appropriate docs (if any) would be appreciated.
Thanks!