A reactive, observable, and optionally constrained implementation of the standard Dart List interface.
TissueList<E> is a core component of the cell_tissue ecosystem,
serving as a high‑performance bridge between the familiar imperative List
API and the framework's Conactive reactive data‑flow graph. It allows
indexed collections to be treated as first‑class reactive entities (cells)
that participate in complex state transitions, validation cycles, and
cross‑thread synchronisation.
When to use
Use a TissueList whenever you need an ordered, indexable collection that:
- Must be observable (UI updates automatically on changes).
- Must enforce invariants (e.g., max length, element type, value range).
- Must be shared between components with different permissions (via deputies).
- Must participate in the reactive graph as a first‑class cell.
Most of the time, you create a TissueList using the TissueList factory,
optionally providing a testRule for validation:
final numbers = TissueList<int>([1, 2, 3]);
final validated = TissueList<int>(
testRule: TestTissue<int>((v) => v > 0),
);
How it works
- Internally, it uses a TissueListNucleus to govern behaviour and a Container for physical storage.
- Every mutation (e.g.,
add,removeAt,operator []=) goes through a validation pipeline (testRule) and emits a TissuePulse. - The list is thread‑safe via its internal Lock.
- It can be deputised to create restricted views (read‑only, scoped authority, etc.) that share the same storage.
- It supports both growable and fixed‑length storage (via the
growableflag). - It automatically links child Cells when they are added, enabling "bubbling" of internal changes.
Example: Basic usage
final list = TissueList<String>(['Hello']);
list.add('World');
print(list.length); // 2
// Listen for changes
list.listen((event) {
if (event.type == Tissue.elementAdded) {
print('Added: ${event.payload}');
}
});
list.add('!'); // prints "Added: !"
Example: Validation
final validList = TissueList<int>(
testRule: TestTissue<int>((v) => v >= 0 && v <= 100),
);
validList.add(50); // allowed
validList.add(150); // rejected – no event emitted
Example: Read‑only deputy for UI
final source = TissueList<String>(['A', 'B']);
final uiView = source.deputy(testRule: TestTissue.readOnly);
// uiView can be safely passed to a widget tree
// Changes to source are reflected in uiView automatically
Type Parameters:
E: The type of elements contained in the list.
See also:
- Tissue – the base interface for all reactive collections.
- TissueListNucleus – the blueprint and configuration for the list.
- UnmodifiableTissueList – a read‑only deputy variant.
AI Agent Guide
Layer: Tissue — the audit book. Not a Cell factory, not a Flow operator. When to use: "record every alert and action" — ordered history, indexable log, 24-month retention = append-only list (not a purge job). When NOT to use:
Live signature: TissueList<E>({bind, context, receptor, testRule, synapses, growable}) / TissueList.of(iterable, {...}) / TissueList.unmodifiable(bind, {...}) — pinned at cell_tissue: 1.2.0
Do NOT confuse with: TissueQueue (FIFO work, not indexable history) and TissueSet (unique membership, order not the story).
Guide: HowTo-Mitose-Tissue.md §2.1 "TissueList — the audit book" (#tissue-list)
Example: example/cell_tissue_example.dart
Cross-layer: rows are appended from Cell.observe (or a harness method it calls), never from the Flow instruction.
Minimal compilable example
final list = TissueList.of(['a', 'b']);
list.add('c');
print(list.length); // 3
- Implemented types
- Available extensions
- ApplyCommandDSL
- CellFlowOperators
- EnumByName
- FutureIterable
- IterableExtensions
- IterableToJSIterable
- ListOfBoolToJSArray
- ListOfNullableBoolToJSArray
- ListOfNullableNumberToJSArray
- ListOfNullableStringToJSArray
- ListOfNumberToJSArray
- ListOfStringToJSArray
- ListToJSArray
- NullableIterableExtensions
- PulseIterableExtension
- TissueListJson
- TissueSkippedReport
Constructors
-
TissueList({Cell? bind, Context context, TissueReceptor<
E, TissueList< receptor, TestTissue<E> >E, TissueList< testRule, Synapses<E> >Pulse, Cell> synapses, bool growable}) -
The primary architectural constructor for creating a TissueList—a
reactive, synchronised, and optionally constrained implementation of
the standard Dart List interface.
factory
-
TissueList.fromJson(Map<
String, dynamic> json, {TissueCellResolver? cellResolver, TissueGovernanceResolver? governanceResolver, bool lenient = false, TestTissue<dynamic, Tissue> lenientFallbackTestRule = TestTissue.readOnly, void onSkipped(List<String> skipped)?, Object? testRule, Context? context, Object? bind, Object? container, Object? user, List<E> ? elements}) -
Reconstructs a TissueList from the canonical JSON produced by
encodeTissue/ TissueListJson.toJson.factory -
TissueList.fromNucleus(TissueListNucleus<
E> properties, {Iterable<E> ? elements}) -
Creates a TissueList instance materialized from a pre‑configured
TissueListNucleus blueprint, optionally ingesting a starting set of data.
factory
-
TissueList.of(Iterable<
E> elements, {Cell? bind, Context context, TissueReceptor<E, TissueList< receptor, TestTissue<E> >E, TissueList< testRule, Synapses<E> >Pulse, Cell> synapses, bool growable}) -
Creates a TissueList populated with elements from an existing Iterable.
factory
-
TissueList.unmodifiable(TissueList<
E> bind, {Context? context, bool unmodifiableElement}) -
Creates a read‑only, reactive projection (Deputy) of an existing TissueList,
enforcing a strict non‑mutation contract while remaining fully synchronised
with the source data.
factory
Properties
-
async
→ ModifiableListAsync<
E> -
Provides an asynchronous interface for performing mutation operations.
no setteroverride
- context → Context
-
The Context defining the authority tier, priority, and security domain
of this collection.
no setterinherited
- first ↔ E
-
The first element.
getter/setter pairinherited
- firstOrNull → T?
-
Available on Iterable<
The first element of this iterator, orT> , provided by the IterableExtensions extensionnullif the iterable is empty.no setter - hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
A stable, serialisable identifier for this cell handle.
no setterinherited
-
indexed
→ Iterable<
(int, T)> -
Available on Iterable<
Pairs of elements of the indices and elements of this iterable.T> , provided by the IterableExtensions extensionno setter - isEmpty → bool
-
Whether this collection has no elements.
no setterinherited
- isGoverned → bool
-
Indicates whether this tissue is governed.
no setterinherited
- isInvalidated → bool
-
Indicates whether this tissue has been invalidated by its
EphemeralPolicy (e.g., TTL expired).
no setterinherited
- isNotEmpty → bool
-
Whether this collection has at least one element.
no setterinherited
- isTerminal → bool
-
Indicates whether this tissue is a terminal node – i.e., it has no
downstream observers and does not broadcast pulses.
no setterinherited
-
iterator
→ Iterator<
E> -
A new
Iteratorthat allows iterating the elements of thisIterable.no setterinherited - last ↔ E
-
The last element.
getter/setter pairinherited
- lastOrNull → T?
-
Available on Iterable<
The last element of this iterable, orT> , provided by the IterableExtensions extensionnullif the iterable is empty.no setter - length ↔ int
-
The number of elements in this Iterable.
getter/setter pairinherited
-
modifiable
→ Iterable<
Function> -
The exhaustive whitelist of functions that can be invoked via
apply.no setterinherited -
nonNulls
→ Iterable<
T> -
Available on Iterable<
The non-T?> , provided by the NullableIterableExtensions extensionnullelements of this iterable.no setter -
reversed
→ Iterable<
E> -
An Iterable of the objects in this list in reverse order.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- single → E
-
Checks that this iterable has only one element, and returns that element.
no setterinherited
- singleOrNull → T?
-
Available on Iterable<
The single element of this iterator, orT> , provided by the IterableExtensions extensionnull.no setter -
skippedReport
→ Map<
String, dynamic> ? -
Available on Tissue<
TheE> , provided by the TissueSkippedReport extension{'wire': [...], 'decode': [...]}skip report, ornullwhen no skip occurred.no setter -
toJS
→ JSArray<
JSBoolean> -
Available on List<
Converts this to a JSArray of JSBooleans.bool> , provided by the ListOfBoolToJSArray extensionno setter -
toJS
→ JSArray<
JSBoolean?> -
Available on List<
Converts this to a JSArray of nullable JSBooleans.bool?> , provided by the ListOfNullableBoolToJSArray extensionno setter -
toJS
→ JSArray<
JSNumber?> -
Available on List<
Converts this to a JSArray of nullable JSNumbers.num?> , provided by the ListOfNullableNumberToJSArray extensionno setter -
toJS
→ JSArray<
JSString?> -
Available on List<
Converts this to a JSArray of nullable JSStrings.String?> , provided by the ListOfNullableStringToJSArray extensionno setter -
toJS
→ JSArray<
JSNumber> -
Available on List<
Converts this to a JSArray of JSNumbers.num> , provided by the ListOfNumberToJSArray extensionno setter -
toJS
→ JSArray<
JSString> -
Available on List<
Converts this to a JSArray of JSStrings.String> , provided by the ListOfStringToJSArray extensionno setter -
toJS
→ JSArray<
T> -
Available on List<
Converts this List to a JSArray by either casting, unwrapping, or cloning the List.T> , provided by the ListToJSArray extensionno setter -
toJSIterable
→ JSIterable<
T> -
Available on Iterable<
A JSIterable wrapper that proxies to the Dart iterable API.T> , provided by the IterableToJSIterable extensionno setter -
toJSProxyOrRef
→ JSArray<
T> -
Available on List<
Converts this List to a JSArray by either casting, unwrapping, or proxying the List.T> , provided by the ListToJSArray extensionno setter -
unmodifiable
→ TissueList<
E> -
Returns a read‑only, reactive projection (Deputy) of this TissueList.
no setteroverride
-
validate
→ TestTissue<
dynamic, Tissue> -
The TestTissue validation logic currently governing this collection.
no setterinherited
-
wait
→ Future<
List< T> > -
Available on Iterable<
Waits for futures concurrently.Future< , provided by the FutureIterable extensionT> >no setter
Methods
-
add(
E value) → void -
Adds
valueto the end of this list, extending the length by one.inherited -
addAll(
Iterable< E> iterable) → void -
Appends all objects of
iterableto the end of this list.inherited -
any(
bool test(E element)) → bool -
Checks whether any element of this iterable satisfies
test.inherited -
apply<
R> (ApplyCommand command, {ApplyTransactionScope? tx}) → FutureOr< ApplyOutcome< R> > -
Executes a governed mutation on this tissue through the command gateway.
inherited
-
asMap(
) → Map< int, E> -
An unmodifiable Map view of this list.
inherited
-
asNameMap(
) → Map< String, T> -
Available on Iterable<
Creates a map from the names of enum values to the values.T> , provided by the EnumByName extension -
attach(
dynamic context) → Iterable< Pulse> -
Available on Iterable<
Returns a new collection of pulses, each with the providedPulse> , provided by the PulseIterableExtension extensioncontextmetadata attached. -
batch(
) → Pulse -
Available on Iterable<
Aggregates multiple signals into a single, flat CollectivePulse.Pulse> , provided by the PulseIterableExtension extension -
byName(
String name) → T -
Available on Iterable<
Finds the enum value in this list with nameT> , provided by the EnumByName extensionname. -
cast<
R> () → List< R> -
Returns a view of this list as a list of
Rinstances.inherited -
clear(
) → void -
Removes all objects from this list; the length of the list becomes zero.
inherited
-
command(
Function function) → ApplyCommandRunner -
Available on Cell, provided by the ApplyCommandDSL extension
Begins assembling a command that invokesfunctionon this cell. -
contains(
Object? element) → bool -
Whether the collection contains an element equal to
element.inherited -
deputy(
{covariant DeputyContext context = DeputyContext.system, covariant TestTissue< dynamic, Tissue> testRule = TestTissue.allowAll, EphemeralPolicy<Cell> ? ephemeralPolicy, Synapses<Pulse, Cell> synapses = Synapses.enabled}) → FutureOr<TissueList< E> > -
Creates a delegated view (deputy) of this list with modified behavioural
and validation logic.
override
-
elementAt(
int index) → E -
Returns the
indexth element.inherited -
elementAtOrNull(
int index) → T? -
Available on Iterable<
The element at positionT> , provided by the IterableExtensions extensionindexof this iterable, ornull. -
every(
bool test(E element)) → bool -
Checks whether every element of this iterable satisfies
test.inherited -
expand<
T> (Iterable< T> toElements(E element)) → Iterable<T> -
Expands each element of this Iterable into zero or more elements.
inherited
-
fillRange(
int start, int end, [E? fillValue]) → void -
Overwrites a range of elements with
fillValue.inherited -
filter<
S> ({required bool test(S value)}) → FlowHandle -
Available on Cell, provided by the CellFlowOperators extension
Materializes a Predicate Integrity Gate—a specialized orchestration instruction designed to conditionally permit pulse evolution. -
firstWhere(
covariant bool test(E element), {covariant E orElse()?}) → E -
The first element that satisfies the given predicate
test.inherited -
flatten(
) → Iterable< Pulse> -
Available on Iterable<
Recursively flattens any nested CollectivePulse structures into a sequence of simple pulses.Pulse> , provided by the PulseIterableExtension extension -
fold<
T> (T initialValue, T combine(T previousValue, E element)) → T -
Reduces a collection to a single value by iteratively combining each
element of the collection with an existing value
inherited
-
followedBy(
covariant Iterable< E> other) → Iterable<E> -
Creates the lazy concatenation of this iterable and
other.inherited -
forEach(
void action(E value)) → void -
Invokes
actionon each element of this iterable in iteration order.inherited -
fromFuture<
S> ({required Future< S> future, Duration? timeout, FutureErrorHandler? onError, bool emitErrorPulse = true}) → FlowHandle -
Available on Cell, provided by the CellFlowOperators extension
Synthesizes a Temporal Resource Bridge from a Future. -
fromIterable<
T> ({required Iterable< T> iterable}) → FlowHandle -
Available on Cell, provided by the CellFlowOperators extension
Synthesizes an Iterative Pulse Bridge from a dynamic iterable. -
fromStream<
S> ({required Stream< S> stream, StreamErrorHandler? onError, bool emitErrorPulse = true}) → FlowHandle -
Available on Cell, provided by the CellFlowOperators extension
Synthesizes a Continuous Pulse Bridge from a Stream. -
getRange(
int start, int end) → Iterable< E> -
Creates an Iterable that iterates over a range of elements.
inherited
-
indexOf(
E element, [int start = 0]) → int -
The first index of
elementin this list.inherited -
indexWhere(
bool test(E element), [int start = 0]) → int -
The first index in the list that satisfies the provided
test.inherited -
insert(
int index, E element) → void -
Inserts
elementat positionindexin this list.inherited -
insertAll(
int index, Iterable< E> iterable) → void -
Inserts all objects of
iterableat positionindexin this list.inherited -
join(
[String separator = ""]) → String -
Converts each element to a String and concatenates the strings.
inherited
-
lastIndexOf(
E element, [int? start]) → int -
The last index of
elementin this list.inherited -
lastIndexWhere(
bool test(E element), [int? start]) → int -
The last index in the list that satisfies the provided
test.inherited -
lastWhere(
covariant bool test(E element), {covariant E orElse()?}) → E -
The last element that satisfies the given predicate
test.inherited -
map<
S, T> ({required T project(S value), MapErrorHandler? onError}) → FlowHandle -
Available on Cell, provided by the CellFlowOperators extension
Materializes a Projective Evolution Gate—a fundamental instruction designed to transform stimulus payloads as they traverse the topography. -
map<
T> (T toElement(E e)) → Iterable< T> -
The current elements of this iterable modified by
toElement.inherited -
mapEach<
T> (T mapper(dynamic payload)) → Iterable< Pulse< T> > -
Available on Iterable<
Transforms the payload of every pulse in the collection while preserving their individual causal traces.Pulse> , provided by the PulseIterableExtension extension -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
of<
T> ({required Iterable< T> values}) → FlowHandle -
Available on Cell, provided by the CellFlowOperators extension
Synthesizes a Fixed Sequence Bridge from a provided collection. -
range(
{required int start, required int count, int step = 1}) → FlowHandle -
Available on Cell, provided by the CellFlowOperators extension
Synthesizes a Counted Pulse Generator—a specialized bridge designed to evolve a sequence of arithmetic integers. -
reduce(
covariant E combine(E value, E element)) → E -
Reduces a collection to a single value by iteratively combining elements
of the collection using the provided function.
inherited
-
remove(
Object? value) → bool -
Removes the first occurrence of
valuefrom this list.inherited -
removeAt(
int index) → E -
Removes the object at position
indexfrom this list.inherited -
removeLast(
) → E -
Removes and returns the last object in this list.
inherited
-
removeRange(
int start, int end) → void -
Removes a range of elements from the list.
inherited
-
removeWhere(
bool test(E element)) → void -
Removes all objects from this list that satisfy
test.inherited -
repeat<
T> ({required T value, int count = 1}) → FlowHandle -
Available on Cell, provided by the CellFlowOperators extension
Synthesizes a Recursive Stimulus Bridge—a specialized generator designed to evolve the same payload multiple times. -
replaceRange(
int start, int end, Iterable< E> replacements) → void -
Replaces a range of elements with the elements of
replacements.inherited -
retainWhere(
bool test(E element)) → void -
Removes all objects from this list that fail to satisfy
test.inherited -
setAll(
int index, Iterable< E> iterable) → void -
Overwrites elements with the objects of
iterable.inherited -
setFirst(
E value) → void -
Sets the first element of the list to the given
value. -
setRange(
int start, int end, Iterable< E> iterable, [int skipCount = 0]) → void -
Writes some elements of
iterableinto a range of this list.inherited -
setValueAt(
int index, E value) → void -
Sets the element at the specified
indexto the givenvalue. -
shuffle(
[Random? random]) → void -
Shuffles the elements of this list randomly.
inherited
-
singleWhere(
bool test(E element), {E orElse()?}) → E -
The single element that satisfies
test.inherited -
skip(
int count) → Iterable< E> -
Creates an Iterable that provides all but the first
countelements.inherited -
skipWhile(
bool test(E element)) → Iterable< E> -
Creates an
Iterablethat skips leading elements whiletestis satisfied.inherited -
sort(
[int compare(E a, E b)?]) → void -
Sorts this list according to the order specified by the
comparefunction.inherited -
sublist(
int start, [int? end]) → List< E> -
Returns a new list containing the elements between
startandend.inherited -
take(
int count) → Iterable< E> -
Creates a lazy iterable of the
countfirst elements of this iterable.inherited -
takeWhile(
bool test(E element)) → Iterable< E> -
Creates a lazy iterable of the leading elements satisfying
test.inherited -
tap<
S> ({required void onValue(S value), TapErrorHandler? onError}) → FlowHandle -
Available on Cell, provided by the CellFlowOperators extension
Materializes a Passive Observation Gate—a specialized orchestration instruction designed to perform side-effects without altering pulse evolution. -
toJson(
{bool lenient = false, TestTissue< dynamic, Tissue> lenientFallbackTestRule = TestTissue.readOnly}) → Map<String, dynamic> -
Available on TissueList<
Encodes this list to its canonical JSON wire form.E> , provided by the TissueListJson extension -
toList(
{bool growable = true}) → List< E> -
Creates a List containing the elements of this Iterable.
inherited
-
toSet(
) → Set< E> -
Creates a Set containing the same elements as this iterable.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
where(
bool test(E element)) → Iterable< E> -
Creates a new lazy Iterable with all elements that satisfy the
predicate
test.inherited -
whereType<
T> () → Iterable< R> -
Creates a new lazy Iterable with all elements that have type
T.inherited -
withStep(
String step) → Iterable< Pulse> -
Available on Iterable<
Appends a diagnostic stage to the causal trace of every pulse in this collection.Pulse> , provided by the PulseIterableExtension extension
Operators
-
operator +(
List< E> other) → List<E> -
Returns the concatenation of this list and
other.inherited -
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
int index) → E -
The object at the given
indexin the list.inherited -
operator []=(
int index, E value) → void -
Sets the value at the given
indexin the list tovalue.inherited
Static Methods
-
create<
E, C extends TissueList< (E> >{Iterable< E> ? elements, Cell? bind, Context? context, TissueReceptor<E, C> ? receptor, TestTissue<E, C> ? testRule, Synapses<Pulse, Cell> ? synapses, Container? container, Record? user, dynamic forceLock = false, TissueListNucleusBase<E, C> ? principal}) → TissueListBase<E, C> -
A high‑level architectural factory for creating a specialised, type‑safe
reactive list with explicit control over its behavioural and structural blueprint.
override