Getting Started
This guide will help you quickly get started with the Jolt reactive state management library.
Installation
Install Jolt using the pub add command:
bash
# Install core package
dart pub add joltFor Flutter projects, it's recommended to install jolt_flutter:
bash
# Recommended: Flutter Widget integration
flutter pub add jolt_flutterFor the Composition API and Setup Widget pattern, install jolt_setup:
bash
# Composition API with automatic resource cleanup
flutter pub add jolt_setupIf using Flutter Hooks, you can install jolt_hooks:
bash
# Optional: flutter_hooks integration
flutter pub add jolt_hooksIf you prefer the Cubit pattern, you can install jolt_surge:
bash
# Optional: Surge pattern (similar to BLoC's Cubit)
flutter pub add jolt_surgeNext Steps
Core Concepts
- Check out Signal to learn the basics of signals
- Read Computed to learn about derived values
- Explore Effect for handling side effects
- Learn about Watcher for fine-grained control
- Study EffectScope for managing effect lifecycles
- Use Batch to optimize batch update performance
- Control Track for fine-grained reactive dependency management
- Check out Extensions for convenient conversion methods
Flutter Integration
- Use Flutter Widgets to build reactive UIs
- Learn about ValueNotifier Integration for integrating with Flutter's system
- Use FlutterEffect for handling UI side effects
- Explore SetupWidget for the composition-based API
Hooks
- Use Jolt Hooks to use reactive primitives in HookWidget
- Use Flutter resource Hooks in SetupWidget
Surge Pattern
- Learn about Surge state management pattern
- Use Surge Widgets to use Surge in Flutter
- Configure SurgeObserver to monitor state changes
Advanced Features
- Handle Async Signal for managing async operations
- Use Collection Signal for handling reactive collections
- Learn about ConvertComputed for type conversion
- Use PersistSignal to save and restore state
- Integrate Stream for stream API integration
- Learn Extending Jolt to create custom reactive primitives and tools
Development Tools
- Use Jolt Lint for code transformation assists and rule checking