I need to execute some hard process in isolated worker in web. So below i my code
// some code above
void _onPrint() async {
final worker = JsIsolatedWorker();
final result = await _worker.run(functionName: 'tooSlowFunction', arguments: {}); // The result is expected
}
static Future<Uint8List> tooSlowFunction() async {
print('I am here');
return Uint8List(0);
}
// some code below
But I get an error
TypeError: t is not a function
worker.js 1:394 _d
worker.js 1:163 onmessage
I need to execute some hard process in isolated worker in web. So below i my code
But I get an error
What is wrong and how to get it work?