CellFlutterDevTools class abstract final

The in-app Cell Inspector.

CellFlutterDevTools is the opt-in entry point for the in-app inspector. Calling CellFlutterDevTools.enable once in main() turns on a global CellRegistry; cells registered through CellFlutterDevTools.register are then visible in CellInspectorOverlay and (in the future DevTools extension) the ext.cellFlutter.* service extensions.

Registration contract (read this)

Registration is explicit. The registry does not magically discover cells — the developer names each cell:

void main() {
  CellFlutterDevTools.enable();
  runApp(const MyApp());
}

class CounterScreenState extends State<CounterScreen> {
  late final counter = Cell.state<int>(initial: 0);

  @override
  void initState() {
    super.initState();
    CellFlutterDevTools.register('counter', counter.cell);
  }
}

This is deliberate: an automatic registry would silently miss cells created before enable() ran, and the developer is the only one who knows which cells matter. (A future cell release may add an automatic registration hook; until then the explicit contract stands.)

Lifecycle

  • enable is idempotent and a no-op in release builds.
  • register opens exactly one Cell.observe link per cell and records every pulse it receives; unregister and clear release those links. Registered cells are never disposed — the registry only observes them.
  • The registry notifies listeners (the overlay) on register, unregister, clear, and every recorded pulse.

See Also:

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

Static Properties

enabled → bool
Whether enable has been called in this isolate.
no setter
registry → CellRegistry
The live cell registry; null until enable is called.
no setter

Static Methods

clear() → void
Removes every registered entry and releases all observation links. No-op when the devtools are disabled (cleanup is always safe).
enable() → void
Enables the inspector. Call once in main().
register(String symbol, Cell cell) → CellRegistryEntry
Registers cell under symbol in the live registry.
resetForTesting() → void
Resets the global state: releases every observation link and returns to the disabled state. For tests and tooling only.
unregister(String symbol) → void
Removes the entry registered under symbol and releases its observation link. No-op when symbol is not registered and when the devtools are disabled (cleanup is always safe).