pump method
Future<void>
pump({
- required WidgetTester tester,
- required Widget child,
- Widget wrapper(
- 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 aWidgetTester.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:
- CellPumpWithCells.pumpWithCells — the underlying pump helper, including the rationale for placing CellScope outside the wrapper.
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,
);
}