Reactive state management for Dart and Flutter using signals, computed values, effects, and reactive collections. Built on alien_signals.
The Jolt ecosystem consists of six packages:
jolt - Core Library
The foundation of Jolt, providing reactive primitives for Dart and Flutter:
Signal<T>- Reactive state containersComputed<T>- Automatically computed derived valuesEffect- Side-effect functionsAsyncSignal<T>- Async state management- Reactive collections:
ListSignal,MapSignal,SetSignal,IterableSignal
jolt_flutter - Flutter Integration
Flutter-specific widgets and utilities for reactive UI:
JoltBuilder- Automatic reactive UI updatesJoltSelector- Fine-grained selector updatesJoltValueNotifier- Integration with Flutter's ValueNotifier system
jolt_setup - Setup Widget & Composition API
Composition API similar to Vue's Composition API for Flutter, with automatic resource management:
SetupWidget- Composition-based widget withsetup()functionSetupMixin- Add composition API to existing StatefulWidgetsSetupBuilder- Inline composition API for quick prototyping- Automatic resource cleanup - No manual dispose() needed
- Hook APIs for controllers, focus nodes, animations, lifecycle, and more
jolt_hooks - Flutter Hooks Integration
Integration with flutter_hooks for using Jolt primitives in HookWidget:
useSignal()- Create reactive signals in hooksuseComputed()- Computed values that rebuild on changesuseJoltEffect()- Side effects with automatic cleanupuseJoltWidget()- Fine-grained reactive widgets- Collection variants:
useSignal.list(),useSignal.map(),useSignal.set() - HookWidget-compatible API that runs on every build
jolt_surge - Signal-Powered Cubit Pattern
A state management pattern inspired by BLoC's Cubit, powered by Jolt Signals:
Surge<State>- Reactive state container similar to CubitSurgeProvider- Provides Surge instances to the widget treeSurgeConsumer- Unified widget for both building UI and handling side effectsSurgeBuilder,SurgeListener,SurgeSelector- Convenience widgets
jolt_lint - Lint & Code Assists
Custom lint rules and code assists for the Jolt ecosystem:
- Hook Rules Enforcement - Ensures hooks are only called in setup or other hooks
- Code Assists - Quick fixes for converting between patterns, wrapping widgets
- Compile-time Safety - Catches async/callback hook usage before runtime
- IDE Integration - Real-time feedback and automatic fixes in your editor
- Pattern Validation - Enforces best practices for Setup Widget and reactive patterns
import 'package:jolt/jolt.dart';
void main() {
final count = Signal(0);
final doubled = Computed(() => count.value * 2);
Effect(() {
print('Count: ${count.value}, Doubled: ${doubled.value}');
});
count.value = 5; // Prints: "Count: 5, Doubled: 10"
}- Official Documentation - Complete guides and API reference
- BLoC's Cubit - Design pattern inspiration for jolt_surge
- alien_signals - Underlying reactive engine
- Flutter Hooks - Flutter Hooks system
This project is licensed under the MIT License - see the LICENSE file for details.