Unmodifiable class abstract

A marker interface indicating immutable/unmodifiable cell variants.

This serves as a runtime and compile-time indicator that a cell or collection:

  • Blocks mutations: All mutating operations will throw UnsupportedError
  • Preserves reactivity: Maintains existing signal propagation
  • Enforces safety: Guarantees immutable view of data

Key Characteristics:

  • Implemented by all unmodifiable cell variants (collections, values, etc.)
  • Checkable via is Unmodifiable at runtime
  • Used by TestActionRule to auto-reject mutations

Example Usage:

final baseCell = CollectiveList<int>([1, 2, 3]);
final unmodifiable = baseCell.unmodifiable;

if (unmodifiable is Unmodifiable) {
  print('This cell is immutable');
  unmodifiable.add(4); // Throws UnsupportedError
}

Architecture Notes:

  • Works with Cell's modifiable set to block operations
  • All mutating methods check this interface first
  • Collections return unmodifiable views rather than copies
Implementers

Constructors

Unmodifiable.new()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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