emitAndSettle<V> method

Future<void> emitAndSettle<V>(
  1. ValueCell<V> cell,
  2. V? value
)

Sets cell's value to value, then pumps until the widget tree settles.

The common assertion pattern: emit, let the graph and widgets catch up, then assert. See the extension-level Async receptor caveats for the one case (Future.delayed / Timer) where pumpAndSettle alone is insufficient.

Parameters:

  • cell: The Emitted Cell. Must be a ValueCell — the method assigns cell.value synchronously. For plain Cell sources, emit through their input cells instead.
  • value: The New Value. Assigned to cell.value before pumping begins. Subject to the cell's own testRule and evolve logic — an update rejected by the cell's integrity gate does not change the value and the tree settles on the previous state.

Returns:

A Future that completes when the frame pipeline is idle — the same completion semantics as WidgetTester.pumpAndSettle.

See Also:

  • emitAndPump — the single-frame variant for observing intermediate state or advancing a timer.
  • CellEmitAndSettle — the extension-level docs, including the async receptor caveats.

Implementation

Future<void> emitAndSettle<V>(ValueCell<V> cell, V? value) async {
  cell.value = value;
  await pumpAndSettle();
}