pump method

Future<void> pump({
  1. required WidgetTester tester,
  2. required Widget child,
  3. Widget wrapper(
    1. Widget child
    )?,
})

Pumps child with the harness's registered cells in a CellScope.

Delegates to CellPumpWithCells.pumpWithCells with the harness's registry as CellPumpWithCells.pumpWithCellscells. The default MaterialApp(home: Scaffold(...)) wrapper is used unless wrapper is supplied.

Parameters:

  • tester: The Active Tester. Supplied per call — the harness does not own a WidgetTester.
  • child: The Widget Under Test.
  • wrapper: Optional Tree Override. Passed through to CellPumpWithCells.pumpWithCells.

Returns:

A Future that resolves once the first frame is built (the same return semantics as WidgetTester.pumpWidget).

Throws:

StateError if dispose has already been called.

See Also:

Implementation

Future<void> pump({
  required WidgetTester tester,
  required Widget child,
  Widget Function(Widget child)? wrapper,
}) async {
  if (_disposed) {
    throw StateError('CellTestHarness: pump called after dispose.');
  }
  await tester.pumpWithCells(
    cells: _cells,
    child: child,
    wrapper: wrapper,
  );
}