circuitry_flutter 0.2.0
circuitry_flutter: ^0.2.0 copied to clipboard
Flutter bridge for Circuitry with InheritedWidget scoping, reactive state matching, and async lifecycle management.
Changelog #
0.2.0 #
Features #
- Taggable Scopes & O(1) Nested Lookup:
CircuitProvidernow accepts an optionaltag: Enumproperty (e.g.tag: AppScope.global).- Merges tagged containers into an ambient
Map<Enum, Circuit>scope down the widget tree. - Descendants can query ancestor tagged containers in O(1) via
CircuitProvider.of(context, tag: ...)andCircuitProvider.maybeOf(context, tag: ...)without expensive ancestor tree walking. - Automatically reacts to ancestor tagged circuit updates while maintaining local untagged provider shadowing.
- DevTools Debug Tag Forwarding:
CircuitProvideraccepts an optionaldebugTag: Stringand forwards it toCircuit.build(wires, debugTag: debugTag)for named inspection in Dart and Flutter DevTools.
- Dependency Update:
- Bumped core engine dependency to
circuitry: ^0.2.0.
- Bumped core engine dependency to
- Refactoring & Modern Dart Idioms:
- Migrated internal widgets and state representations to Dart 3.14+ primary constructors and exhaustive switch expression pattern matching.
0.1.0 #
Initial release of Circuitry Flutter: the Flutter companion package for Circuitry.
Features #
- Pure Dart Core Re-export: Re-exports
package:circuitry/circuitry.dartso Flutter applications only need to depend oncircuitry_flutter. - Sealed
CircuitStateHierarchy: Pattern matchCircuitBuilding,CircuitReady, andCircuitFailureusing modern Dart 3 switch expressions. - Asynchronous Build Lifecycle (
CircuitProvider): Asynchronously compilesCircuitWirerecipes, displays loading/splash UI while resolving, and wraps child widgets in an internalInheritedWidgetscope once ready. - Monotonic Epoch Race Prevention: Safely handles dynamic wire updates (
didUpdateWidget) without race conditions, canceling and disposing superseded in-flight builds. - Automatic Unmount Cleanup: Automatically tears down and disposes the active circuit when
CircuitProvideris unmounted from the widget tree. - Synchronous Value Injection (
CircuitProvider.value): Injects pre-compiledCircuitinstances for widget test harnesses or sub-trees without managing lifecycle disposal. - Explicit Scoped Accessors: Context retrieval via
CircuitProvider.of(context)andCircuitProvider.maybeOf(context)withoutBuildContextextension pollution.