rx_flow 1.1.0 rx_flow: ^1.1.0 copied to clipboard
State manager for flutter.
RxFlow #
state manager with rxdart
This package provides:
- RxDart
- GetIt (dependency injection)
- SharedPreferences (persistent store)
how to use #
abstract class IUserController extends IController {
RxState<UserData> userData$;
}
class UserControllerImpl extends IController {...}
Locator.global.register<IUserController>(UserControllerImpl);
class MyWidget extends RxConsumer {
@override
Widget build(BuildContext context, watcher) {
final userController = watcher.controller<IUserController>();
final userData = watcher.watch(userController.userData$)
return ...
}
}
// Provider
Widget build(BuildContext context, watcher) {
return LocatorProvider(
locator: Locator() // or Locator.global
child: ...
);
}