pump method

  1. @override
Future<void> pump([
  1. Duration? duration,
  2. EnginePhase phase = EnginePhase.sendSemanticsUpdate
])
override

Triggers a frame after duration amount of time.

This makes the framework act as if the application had janked (missed frames) for duration amount of time, and then received a "Vsync" signal to paint the application.

For a FakeAsync environment (typically in flutter test), this advances time and timeout counting; for a live environment this delays duration time.

This is a convenience function that just calls TestWidgetsFlutterBinding.pump.

See also LiveTestWidgetsFlutterBindingFramePolicy, which affects how this method works when the test is run with flutter run.

Implementation

@override
Future<void> pump([
  Duration? duration,
  EnginePhase phase = EnginePhase.sendSemanticsUpdate,
]) {
  return TestAsyncUtils.guard<void>(() => binding.pump(duration, phase));
}