β‘ Hybrid_manager
A powerful yet lightweight state management solution for Flutter that combines the best of GetX and Riverpod. Use class-based or functional state handling, scoped overrides, and hot-reload-friendly APIs β all in one clean package.
β¨ Features
- π
Reactive<T>for reactive state (like GetX's Rx) - π§
StateNotifier<T>for class-based state logic (like Riverpod's StateNotifier) - π±
Provider<T>andScopedProvider<T>for dependency injection and state scoping - π‘
watch()andread()for clean, functional state access - π Hot-reload friendly design
- π§ͺ Optional code generation for advanced performance
- π CLI tooling support (coming soon)
Getting Started
Add the package to your pubspec.yaml:
dependencies:
hybrid_manager: ^0.0.1
Then run:
flutter pub get
Usage
Functional Reactive State
final counter = Reactive<int>(0);
counter.listen((value) => print('New value: $value'));
counter.value++; // prints: New value: 1
Class-based Notifier
class CounterNotifier extends MyStateNotifier<int> {
CounterNotifier() : super(0);
void increment() => state++;
}
Register it:
final counterProvider = createNotifier(() => CounterNotifier());
Use it:
final counter = watch(counterProvider);
Scoped Overrides
ProviderScope(
overrides: [
counterProvider.overrideWithValue(CounterNotifier()..state = 999),
],
child: MyApp(),
);
Coming Soon
- Built-in testing utilities
- CLI to scaffold providers/notifiers
- Code generation annotations like
@yourProvider
License
MIT License
Author
omJamnekar GitHub
π Contributions
Feel free to open issues or pull requests! Help improve this package and make Flutter state management more enjoyable.