Cell class abstract interface Getting Started Core 16 Operators Demo:aircraft Demo:hotel Core

A reactive node: holds state (or relays signals), validates every incoming change against a policy, and broadcasts accepted changes to whatever else is listening.

Internally, a Cell's behavior is split into four independent, swappable pieces — a Receptor (how it transforms an incoming Pulse), a TestCell (what it's allowed to accept), a Context (what tier/domain it belongs to), and Synapses (who it notifies on change). You don't construct any of these directly for ordinary use — they all have working defaults, and the static operators below hide them entirely.

Where to start

First 16 operators: Almost everything is built from one of these. They will cover most of your daily reactive programming needs. They're ordered from most essential to more advanced.

These are ordered for a learning path: get data in → hold state → react in the UI → shape streams → go async → combine sources.

Each works with zero knowledge of Receptor, TestCell, Context, or Synapses — all optional, all defaulted. They represent the Standard Entry Point, allowing you to build complex reactive systems by connecting simple building blocks. While you focus on your logic, the framework automatically manages the input (Ingress), logic (Transformation), and notifications (Egress), handling all security checks and verification steps in the background.

Identity

A cell obtained via deputy or unmodifiable is a proxy, not a copy — it shares its principal's underlying state. cell == cell.deputy() is true; they're interchangeable in Sets and Maps. What differs is what each is permitted to do (validate), never what data it holds.

Going further

Cell.governed and Cell.fromNucleus expose full control over lifecycle, security tier, and concurrency. Reach for these only when the operators above are genuinely insufficient — e.g. building infrastructure nodes, not typical application state.

For a rich ecosystem of reactive primitives, see cell_flow—a complementary library providing 90+ instruction-layer Flow factories for complex stream orchestration, advanced filtering, and high-level data synchronization.

See Also:

  • Pulse (the signal a cell processes).
  • ValueCell (the concrete stateful type returned by Cell.state).
  • HowTo: See guide/HowTo-Start.md for a comprehensive guide on getting started with the Cell architecture and reactive patterns.
Implementers

Constructors

Cell({Cell? bind, Receptor<Cell> receptor, TestCell<Cell> testRule, Synapses<Pulse, Cell> synapses})
Creates a standard, stateful Cell instance—the foundational execution node of the reactive network.
factory
Cell.fromNucleus(Nucleus nucleus)
Activates a live Cell instance from a pre-configured Nucleus blueprint.
factory
Cell.governed({EphemeralPolicy<Cell>? ephemeralPolicy, Context context, Cell? bind, Receptor<Cell> receptor, TestCell<Cell> testRule, Synapses<Pulse, Cell> synapses, bool forceLock})
Synthesizes a fully managed Cell instance with explicit control over its Identity Lifecycle, Administrative Policy, and Atomic Isolation.
factory

Properties

async ModifiableAsync<Cell>
Provides a high-level, asynchronous interface for interacting with this Cell node.
no setter
context Context
The operational Context defining the forensic identity, administrative authority, and causal lineage of this specific Cell handle.
no setter
hashCode int
The hash code for this object.
no setterinherited
isGoverned bool
Indicates whether this node is subject to active Administrative Oversight or specialized Lifecycle Governance.
no setter
isInvalidated bool
Indicates whether this Cell has initiated its Automatic Termination sequence and is currently in the process of being neutralized.
no setter
isTerminal bool
A boolean indicator identifying whether this Cell acts as a Processing Sink within the reactive topology.
no setter
modifiable Iterable<Function>
Defines the exhaustive whitelist of functions and commands authorized for execution on this node via the dynamic apply method.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
unmodifiable Cell
Returns a read-only, reactive projection (Deputy) of this Cell.
no setter
validate TestCell<Cell>
The authoritative Integrity Gate governing this node's structural boundaries and operational authority.
no setter

Methods

apply(Function function, {List? positionalArguments, Map<Symbol, dynamic>? namedArguments, ApplyTransactionScope? tx, Function? compensate, List? compensatePositional, Map<Symbol, dynamic>? compensateNamed, Cell? compensateCell}) → dynamic
Executes a State Transition or arbitrary logic via the Command Pattern gateway.
deputy({covariant DeputyContext context = DeputyContext.system, covariant TestCell<Cell> testRule = TestCell.allowAll, EphemeralPolicy<Cell>? ephemeralPolicy, Synapses<Pulse, Cell> synapses = Synapses.enabled}) FutureOr<Cell>
Creates an Attenuated Proxy (Deputy) of this cell with specialized governance and restricted authority.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

asyncMap<S, T>(Cell source, Future<T> mapper(S value), {int concurrency = 0, bool latestOnly = false, bool exhaust = false}) Cell
Synthesizes an Asynchronous Data Transformer—a specialized node that runs background tasks for every emission from an upstream source.
debounce(Cell source, Duration duration, {bool leading = false, EphemeralPolicy<Cell>? ephemeralPolicy}) Cell Core 16 Operators
Limits propagation by waiting for a period of stability in the source (classic Rx debounceTime).
derive<I extends Pulse, O extends Pulse>({required Cell source, required O? project(I input)}) Cell Core 16 Operators
Synthesizes a new Cell that acts as a Reactive Projection (or View) of an existing source cell.
distinct(Cell source, {bool equals(dynamic previous, dynamic next)?}) Cell Core 16 Operators
Filters out consecutive duplicate payloads from a source Cell.
fromFuture<T>(Future<T> future) Cell Core 16 Operators
Creates a Cell that emits the result of a Future exactly once.
fromStream<T>(Stream<T> stream, {bool cancelOnError = false, EphemeralPolicy<Cell>? ephemeralPolicy}) Cell Core 16 Operators
Creates a Cell that emits the values produced by a Dart Stream.
hub({Map<String, Pulse? Function(Cell cell, Pulse pulse, {dynamic user})>? spokes, Map<DeputyContext, Receptor<Cell>>? governedSpokes, List<SpokeRegistration>? registrations, HubRouting routing = HubRouting.exact, bool multicast = false, String? fallback, Synapses<Pulse, Cell> distribution(String role)?, void relay(Pulse pulse)?, Cell? source}) HubHandle Core 16 Operators
Synthesizes a Multi-Destination Router—a specialized node that acts as a reactive demultiplexer, directing signals to specialized handlers.
ingress<I>({Pulse<I?>? refine(Cell host, Pulse<I> input)?, EphemeralPolicy<Cell>? ephemeralPolicy, Cell? source, Context context = Context.system, Receptor<Cell> receptor = Receptor.passThrough, TestCell<Cell> testRule = TestCell.allowAll, Synapses<Pulse, Cell> synapses = Synapses.enabled, bool forceLock = false}) IngressHandle<I> Core 16 Operators
Synthesizes a Stateless Event Gateway—the primary entry point for bridging imperative signals into the reactive graph.
observe<P extends Pulse>({required Cell source, required void effect(P pulse), bool initiallyStarted = true}) EgressHandle<P> Core 16 Operators
Synthesizes an Output Terminal designed to observe the reactive graph and emit imperative side effects.
open({EphemeralPolicy<Cell>? ephemeralPolicy, Context context = Context.system, Cell? source, Receptor<Cell> receptor = Receptor.passThrough, TestCell<Cell> testRule = TestCell.allowAll, Synapses<Pulse, Cell> synapses = Synapses.enabled, bool forceLock = false}) OpenCell Core 16 Operators
Synthesizes a Manual Control Interface—a specialized node that allows you to manually push data into the reactive network or change how cells are connected at runtime.
sanitized<P extends Pulse>(Cell source, {required P redact(P pulse), Sensitivity minSensitivity = Sensitivity.confidential}) Cell Core 16 Operators
Synthesizes a Privacy Guard—a security-hardened node that automatically modifies Pulse payloads based on their Sensitivity and compliance mandates.
state<V>({V? initial, Pulse<V>? evolve(ValueCell<V> host, Pulse input)?, TestCell<Cell> testRule = TestCell.allowAll}) StateHandle<V> Core 16 Operators
Synthesizes a Stateful Micro-Service—the primary primitive for reactive state management.
switchMap<S, T>(Cell source, Cell mapper(S value)) Cell Core 16 Operators
Synthesizes a Dynamic Provider Switch—a specialized node that swaps its data source at runtime based on the selection from another cell.
synthesis<P extends Pulse>(Iterable<Cell> sources, {required P? aggregator(Iterable<Cell> cells, Pulse emit)}) Cell Core 16 Operators
Synthesizes a Multi-Source Convergence Node—the primary primitive for merging disparate data streams into a unified reactive output.
throttle(Cell source, Duration duration, {bool leading = true, bool trailing = false}) Cell Core 16 Operators
Limits the frequency of updates from a source cell by enforcing a minimum duration between emissions.
transaction([TransactionOptions options = const TransactionOptions()]) TransactionScope Advanced
Creates an atomic multi-cell transaction with configurable isolation.
txApply([TxApplyOptions options = const TxApplyOptions()]) ApplyTransactionScope Advanced
An Atomic Evolution Sequencer that executes multiple state mutations within a single coordinated transaction.
valve<P extends Pulse>(Cell source, bool gate(P pulse), {Synapses<Pulse, Cell> synapses = Synapses.enabled}) Cell Core 16 Operators
Synthesizes a Conditional Gate—a specialized node that acts as a reactive circuit breaker, controlling signal propagation through the graph.