isolator
2.0.8, released 4 years ago by alphamikle.dev
Create two-component states with an isolated backend part and a frontend part for UI-isolates.
What it does
Isolator splits state logic into a Frontend component that runs in the UI thread and a Backend component that runs in a separate isolate. It enables communication between them to handle CPU-heavy computations or big-data parsing without dropping UI frames. It also supports interactors for communication between different backends.
AI-written summary of version 2.0.8, based on the package's README and metadata. Report an inaccuracy
Use it when
- You have heavy CPU-bound tasks or data parsing that causes jank in the UI isolate
- You want to organize state into isolated backend components and frontend UI components
Skip it when
- Your application is simple and state management can be handled on a single thread without performance issues
- You are targeting platforms where isolates have limitations or you prefer standard single-threaded state managers
Strengths
- Keeps the UI thread unblocked for smooth 60/120 fps animations
- Provides a structured way to run business logic in background isolates without complex boilerplate
Weaknesses
- Adds architectural complexity with split Frontend and Backend components
- Does not provide true multi-threading on Flutter Web due to platform limitations
Setup
- Kind
- Flutter widgets
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 1
Requires structuring state into paired Frontend and Backend components rather than standard single-class state management.
// Minimal example not documented in detail in the provided README excerptAlternatives
Packages that do the same job and could replace isolator.
- flutter_bloc
If you want standard single-threaded reactive state management with extensive community plugins and widgets.
86Compare - riverpod
If you prefer a compile-safe, modern provider-based state management solution without managing isolates manually.
99Compare