nstater 0.0.4 copy "nstater: ^0.0.4" to clipboard
nstater: ^0.0.4 copied to clipboard

NStater is a minimal and fast way to manage state in Flutter. You control the lifecycle of controllers and reactive values yourself, using your own types and subscriptions.

pub package pub points likes

NStater β€” lightweight state management with zero dependencies #

NStater is a minimal and fast way to manage state in Flutter. You control the lifecycle of controllers and reactive values yourself, using your own types and subscriptions.

πŸ“¦ Features #

  • NVar β€” a typed reactive variable that notifies listeners about changes
  • NField β€” a widget that listens to an NVar and rebuilds only when the value actually changes
  • NController β€” a base state controller class
  • NState β€” widget that creates a controller and manages its lifecycle
  • No dependency on ChangeNotifier/ValueNotifier
  • You can combine multiple NVar Ρ‰ΠΊ NController instances on a single screen

πŸ” Quick API #

NVar<T> #

Reactive value with subscribe / unsubscribe:

final n = NVar<int>(0);
n.addListener((v) => print('new value: $v'));
// new value: 0
n.value = 42;
print(n.value);
// 42

NField<T> #

A widget that listens to an NVar and rebuilds only when the value actually changes:

NField<int>(
  data: counter,
  builder: (v) => Text('$v'),
);

NController #

Base controller class with subscriptions and no dependencies:

class MyController extends NController {
  int count = 0;
  void inc() {
    count++;
    notify();
  }
}

NState<C extends NController> #

Builds UI based on a controller and automatically creates and disposes it:

NState<MyController>(
  create: () => MyController(),
  builder: (c) => Text('${c.count}'),
);
0
likes
0
points
23
downloads

Publisher

verified publisherntk-team.space

Weekly Downloads

NStater is a minimal and fast way to manage state in Flutter. You control the lifecycle of controllers and reactive values yourself, using your own types and subscriptions.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on nstater