hybrid_manager 0.0.2
hybrid_manager: ^0.0.2 copied to clipboard
A hybrid state management library combining GetX and Riverpod.
⚡ 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) - 🧠
MyStateNotifier<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:
your_package_name: ^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.