easy_isolate_mixin
1.0.1, released 3 years ago by an unverified publisher
Mixin that runs functions in a separate Dart isolate to keep the UI responsive.
What it does
Provides an IsolateHelperMixin with a loadWithIsolate method. The method executes a supplied function in a background isolate and returns its result as a Future. It simplifies isolate usage in Flutter apps.
AI-written summary of version 1.0.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to perform CPU‑intensive work without blocking the main thread
- You want a quick way to offload data processing or API calls to an isolate
Skip it when
- The task is trivial and doesn’t justify isolate overhead
- Running on platforms that don’t support isolates (e.g., web)
Strengths
- Very easy to integrate via a mixin
- Works with Flutter plugins and multiple platforms
Weaknesses
- Limited to Flutter (no web support)
- Provides only basic isolate handling, no advanced error or cancellation features
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
import 'package:easy_isolate_mixin/easy_isolate_mixin.dart';
class Service with IsolateHelperMixin {
Future<int> computeHeavy() async {
return await loadWithIsolate(() => heavyCalculation());
}
int heavyCalculation() {
// expensive sync work
return 42;
}
}Alternatives
Packages that do the same job and could replace easy_isolate_mixin.
- isolate_channel
Communication channels for isolates based on Flutter's platform channels.
82Compare - flutter_isolate
Run Dart isolates in Flutter that can interact with Flutter plugins.
50Compare
Works with
Packages commonly used together with easy_isolate_mixin: ones it builds on, ones built on it, and its own family.