flutter_isolate
2.1.0, released 2 years ago by an unverified publisher
Run Dart isolates in Flutter that can interact with Flutter plugins.
What it does
Allows you to spawn and manage Dart isolates in Flutter that have access to platform plugins. It provides APIs similar to standard isolates along with `flutterCompute` to execute expensive tasks off the main thread.
AI-written summary of version 2.1.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to run long-running or CPU-intensive background tasks that must interact with Flutter plugins
- You want to offload work from the main UI thread on Android and iOS
Skip it when
- Standard Dart isolates or Flutter's built-in compute function are sufficient and plugin access inside the isolate is not required
- You want automatic event loop termination when work completes (FlutterIsolates require explicit termination)
Strengths
- Enables plugin usage inside spawned background isolates
- Supports custom plugin registrants for both iOS and Android
- Provides a simple `flutterCompute` wrapper for single tasks
Weaknesses
- Event loop will not terminate automatically, requiring explicit `kill()` calls
- Has not been tested with a wide range of plugins
- Entrypoints require specific `@pragma('vm:entry-point')` annotations to prevent release mode crashes
Setup
- Kind
- Plugin (native code)
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 1
Entrypoint functions must be top-level or static and decorated with @pragma('vm:entry-point'). Custom plugin registrants may need platform-specific configuration in Swift or Java.
import 'package:flutter_isolate/flutter_isolate.dart';
@pragma('vm:entry-point')
void someFunction(String arg) {
print("Running in an isolate with argument : $arg");
}
void runIsolate() {
FlutterIsolate.spawn(someFunction, "hello world");
}Alternatives
Packages that do the same job and could replace flutter_isolate.
- isolate_channel
Communication channels for isolates based on Flutter's platform channels.
82Compare - isolated_object
Wraps an object in a dedicated isolate and forwards method calls to it
79Compare - easy_isolate
Provides a simple abstraction over Dart isolates for running code on background threads.
53Compare - package_signature
Retrieve Android package signature (SHA1/SHA256) in a Flutter app.
66Compare
Works with
Packages commonly used together with flutter_isolate: ones it builds on, ones built on it, and its own family.
- uuidflutter_isolate depends on itGenerates and parses RFC‑4122/9562 UUIDs (v1‑v8) for Dart.
- network_tools_flutterBuilt on flutter_isolateExtended network tools and scanning features for Flutter supporting iOS and Android.
- isolate_handlerBuilt on flutter_isolateAbstraction layer for Dart isolates with inter-isolate communication and plugin support.