Skip to main content

prefer-compute-over-isolate-run

has auto-fix
pro+

Suggests using compute(...) over Isolate.run(...).

Isolate.run() does not support the web platform and if you are targeting it, it's recommended to use compute() to ensure your code works as expected.

Example

❌ Bad:

void fn() {
// LINT: Prefer using 'compute()' instead of 'Isolate.run()' for web platform compatibility.
Isolate.run(...);
}

✅ Good:

void fn() {
compute(...);
}

Additional Resources