armature_flutter 1.0.0
armature_flutter: ^1.0.0 copied to clipboard
Flutter integration for armature: ArmatureApp bootstrap, slot widgets, reactive providers, and a debug overlay.
1.0.0 #
First stable release. Tracks
armature1.0.0; existing widgets and providers from 0.4.0 are unchanged. New widgets (StoreListener,TaskBuilder) are additive.
Added #
-
StoreListener<S>— side-effect host for aStore<S>that fires the listener on transitions without rebuildingchild. The state generic infers from thestore: Store<S>argument; an optionallistenWhen: (prev, next) => ...predicate filters which transitions trigger the callback. Use for navigation, snackbars, analytics — anywhereStoreBuilderwould over-rebuild.StoreListener( store: context.store<AuthStore>(), listenWhen: (p, n) => !p.isLoggedIn && n.isLoggedIn, listener: (ctx, _) => Navigator.of(ctx).pushReplacementNamed('/home'), child: const LoginForm(), ) -
TaskBuilder— reactive four-way switch onTask.state. All three generics (TParams,TResult,TError) infer from thetaskargument; the four branch builders (idle,pending,done,failed) are required so the compiler enforces exhaustive coverage.TaskBuilder( task: store.fetchUser, // Task<int, User, ApiException> idle: (_) => const _Placeholder(), pending: (_, userId) => const CircularProgressIndicator.adaptive(), done: (_, user) => UserCard(user), failed: (_, e) => ErrorBanner(message: e.message), )
Performance #
MultiPortBuilderbuild hoists — the per-buildtrackedSet,_reconcilestaleList, and error-reporter closure are now allocated once ininitStateand reused, instead of being recreated on every reactive rebuild.MultiSlot.applyempty-handlers / empty-entries fast paths — returninitialValuedirectly when the port has no registered handlers, or when no active feature contributes a descriptor for the currentdatapayload, instead of allocating an emptyentrieslist and copyinginitialValueinto a newList<Widget>.
Internal #
- Switched from
package:armature/advanced.darttopackage:armature/framework.dartforPort/PortType. Theframework.dartbarrel is the new home for sibling-package plumbing types.
Depends on #
armature: ^1.0.0(was^0.4.0).
0.4.0 #
Tracks the
armature0.4.0 container lifecycle rename. No new Flutter-side surface — but consumers that calleddispose()on a container directly must migrate.
Changed #
ArmatureAppnow callscontainer.stop()instead ofcontainer.dispose()when the widget is disposed. With the new restart-friendly cycle, the container can bestart()-ed again from user code if the sameArmatureAppis remounted.container_dispose_test.dartremoved; the equivalent restart-cycle coverage now lives inarmature'scontainer_test.dart.
Migration #
- Any user code that called
container.dispose()directly (for example, when bootstrapping a container outsideArmatureApp) must switch tocontainer.stop(). See thearmature0.4.0 changelog for the full rationale.
Documentation #
SlotDescriptor,SlotLoaderBuilder, andRenderer.renderLoaderdoc-comments now referenceFeatureStatus.pending/FeatureStatus.active/ContainerStatus.startingexplicitly instead of the.pending/.activeshorthand.- Provider and renderer files (
single_slot_provider.dart,multi_slot_provider.dart,flutter_renderer.dart) cleaned up the same way. - README aligned with the current API surface.
Depends on #
armature: ^0.4.0— see that package's CHANGELOG for the lifecycle rename details.armature_reactive: ^1.0.0(was^0.1.0) — first stable release; public API unchanged.
0.3.1 #
Docs and example refresh. No library code changes.
Changed #
- README updated to align terminology with the current API surface
(keyed slots,
.queue/ascdefaults,package:armature/advanced.dartbarrel, explicitFeatureStatus/ToggleState). example/example.dartswitches to the newcleanup.subscribe(...)sugar fromarmature0.3.1.
0.3.0 #
Fixed #
- Per-container renderer — the pre-0.3.0
rendererContextglobal singleton has been replaced by a per-AppContainerrenderer slot, accessed via the newContainerRendererextension (container.renderer). TwoArmatureApps living sibling-by-sibling or mounting / unmounting in rapid succession each carry their own renderer — the previous race where an outgoing widget's async dispose nulled out the incoming widget's renderer is gone.
BREAKING (internal) #
rendererContextglobal removed.ArmatureApp.initStateandbootstrap()now callcontainer.setRenderer(...)instead of assigning the global. Custom renderers and slot implementations read viacontainer.renderer.initTestRendererintest_utils.dartnow takes anAppContainer:initTestRenderer(container).pumpFeatureinstalls aFlutterRendererlazily on each container, so most widget tests don't need to callinitTestRendererdirectly anymore.useSingleSlot/useMultiSlotextensions record the binding into the feature's config (via the new internalFeature.recordPortBindinghelper) instead of callingport.addHandler. User-facing API is unchanged.- Slot widget builders use
container.renderer.renderSlot(...)instead ofrendererContext.renderer.renderSlot(...). Thecontaineris available at every existing call site — no extra plumbing needed.
Depends on #
armature: ^0.3.0— see that package's CHANGELOG for the full config/runtime split.
0.2.0 #
Note: This release has breaking changes.
- BREAKING FEAT(website): add interactive docs and examples site. (f30d28c1)
0.1.0 #
- Initial release — Flutter integration for
armature:ArmatureApp— top-level widget that bootstraps the container and installs providers.bootstrap(...)remains as the manual alternative for custom lifecycles.FeatureRoot/createFeatureRoot— mounts a feature as a top-level root widget via its descriptor (widget:+ optionalloader:).- Slot widgets:
SingleSlot,MultiSlot,SingleSwitchSlot,MultiSwitchSlot. Registration via the typedfeature.useSingleSlot(...)/useMultiSlot(...)extensions — handlers returnWidget?and the framework wraps them into descriptors. - Port providers:
PipeProvider,BehaviorProvider,SingleSlotProvider,MultiSlotProvider,MultiPortBuilder/PortReaderfor multi-port reactive reads. - Store widgets:
context.store<T>()— one-shot imperative store lookup.StoreBuilder<T>— reactive DI + rebuild on any tracked state change.StoreSelector<V>— equality-based rebuild on derived values, for multi-store projections and fine-grained optimisation.StateObserver— raw reactive wrapper for custom builders.
- Renderer: pluggable
Rendererinterface withFlutterRendereras the default;FlutterRendererOptions.errorBuilder/loaderBuilderfor customising slot error / loading states. - Debug overlay:
FeatureGraphOverlay— interactive feature-graph canvas with pan / zoom / drag, node detail panel, live store inspector, minimap, refresh button, gesture hint. - Test utilities (
package:armature_flutter/test_utils.dart):initTestRenderer,wrapForTesting,pumpFeature.