rx_flow 1.2.2 copy "rx_flow: ^1.2.2" to clipboard
rx_flow: ^1.2.2 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: ...
    );
  }