nstater 0.1.0
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 makeNState<C>accept only compatible controllers. Invalid controller types now fail at compile time instead of during widget mounting. - Make
dispose()terminal forNVarandNController. 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()andonInit()before the firstNStatebuild, so initialized state is visible immediately. - Run
NController.onReady()after the first frame instead of in a microtask. - Correctly handle enabling or replacing
NField.shouldRebuildwhile keeping the sameNVarinstance. - Report listener failures through
FlutterError.reportErrorwhile continuing to notify the remaining active listeners. - Take an immutable snapshot of
NVarCombinersources to prevent subscription leaks caused by later mutations of the input collection.
Added #
- Add the global
N.servicesservice locator with synchronous and asynchronous singleton registration, named services, automatic replacement, lookups, unregister/reset operations, and a stream of lifecycle events. - Add
NDisposableso registered services can provide automatic cleanup when they are replaced, unregistered, or reset. - Add the
NService.isGlobalownership contract. Registered controllers are marked global automatically, andNStatenever disposes them; only their service registry owner can do so. - Add
isDisposedtoNVarandNController. - Add custom result equality to
NVarCombinerthroughisEqual. - 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.dartentrypoint. - Exclude generated coverage reports from source control and package archives.
0.0.6 #
- Add
NVarCombinerclass for combining multiple NVar sources into computed values - Add tests
- Update documentation with NVarCombiner examples and use cases
0.0.5 #
- Add
isEqualparameter to NVar for custom equality comparison - Add
shouldRebuildparameter 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