Skip to content
pubscout

easy_isolate

1.3.1, released 2 years ago by britto.dev

Provides a simple abstraction over Dart isolates for running code on background threads.

$ flutter pub add easy_isolate

What it does

It offers a Worker class to manage a dedicated isolate with message passing, error/exit handling, and optional queue mode. It also includes a Parallel helper to run, map, or foreach functions across isolates.

AI-written summary of version 1.3.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to offload heavy CPU‑bound work without writing raw isolate boilerplate
  • You want a lightweight way to run functions in parallel on multiple isolates

Skip it when

  • You only need simple async futures (no separate thread needed)
  • You require platform‑specific native code or UI widgets

Strengths

  • Minimal API for common isolate patterns
  • Supports queue mode and immediate disposal
  • No external dependencies
  • Works on all Flutter platforms

Weaknesses

  • Only supports primitive message types (objects must be plain data)
  • No built‑in support for stream‑based communication
  • Limited to top‑level/static handlers

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
0
void main() async {
  final worker = Worker();
  await worker.init(mainHandler, isolateHandler);
  worker.sendMessage('ping');
}

void mainHandler(dynamic data, SendPort isolateSendPort) {
  print('From isolate: $data');
}

void isolateHandler(dynamic data, SendPort mainSendPort, SendErrorFunction onSendError) {
  mainSendPort.send('pong');
}

Alternatives

Packages that do the same job and could replace easy_isolate.

  • async

    Provides utilities like FutureGroup and StreamQueue for managing async tasks without isolates