nstater 0.1.0 copy "nstater: ^0.1.0" to clipboard
nstater: ^0.1.0 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.

0.1.0 #

Breaking changes #

  • Constrain NController<T> to its controller type and make NState<C> accept only compatible controllers. Invalid controller types now fail at compile time instead of during widget mounting.
  • Make dispose() terminal for NVar and NController. Value updates and new listeners are ignored after disposal.
  • Stop the current notification cycle when a listener disposes its owner, and skip listeners removed earlier in the same cycle.

Fixed #

  • Run NController.beforeMount() and onInit() before the first NState build, so initialized state is visible immediately.
  • Run NController.onReady() after the first frame instead of in a microtask.
  • Correctly handle enabling or replacing NField.shouldRebuild while keeping the same NVar instance.
  • Report listener failures through FlutterError.reportError while continuing to notify the remaining active listeners.
  • Take an immutable snapshot of NVarCombiner sources to prevent subscription leaks caused by later mutations of the input collection.

Added #

  • Add the global N.services service locator with synchronous and asynchronous singleton registration, named services, automatic replacement, lookups, unregister/reset operations, and a stream of lifecycle events.
  • Add NDisposable so registered services can provide automatic cleanup when they are replaced, unregistered, or reset.
  • Add the NService.isGlobal ownership contract. Registered controllers are marked global automatically, and NState never disposes them; only their service registry owner can do so.
  • Add isDisposed to NVar and NController.
  • Add custom result equality to NVarCombiner through isEqual.
  • Add lifecycle, disposal, reentrant notification, and selective rebuild tests.
  • Add CI checks for formatting, static analysis, tests, coverage, and package publication validation.

Changed #

  • Re-registering a service now disposes the previous instance, installs the new one, emits NServiceEventType.replaced, and writes a diagnostic message that does not expose either service instance.
  • Make the example application depend on the local package and use the public package:nstater/nstater.dart entrypoint.
  • Exclude generated coverage reports from source control and package archives.

0.0.6 #

  • Add NVarCombiner class for combining multiple NVar sources into computed values
  • Add tests
  • Update documentation with NVarCombiner examples and use cases

0.0.5 #

  • Add isEqual parameter to NVar for custom equality comparison
  • Add shouldRebuild parameter to NField for selective rebuilds
  • Add dispose() method to NVar and NController
  • Improve error handling with try-catch and debug logging
  • Add disposed state protection in NController

0.0.4 #

  • format fix
  • readme add badges

0.0.3 #

  • add example

0.0.2 #

  • code style fixes

0.0.1 #

initial release

0
likes
150
points
12
downloads

Documentation

API reference

Publisher

verified publisherever-zen.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

MIT (license)

Dependencies

flutter

More

Packages that depend on nstater