Future<String> bake() async { final p = ReceivePort(); // spawn the isolate and wait for it to complete await Isolate.spawn(_xxHashIsolate, p.sendPort); // get and return the result data return await p.first; }