Future<Null> pumpWidget(Widget widget, [ Duration duration, EnginePhase phase = EnginePhase.sendSemanticsTree ])

Renders the UI from the given widget.

Calls runApp with the given widget, then triggers a frame and flushes microtasks, by calling pump with the same duration (if any). The supplied EnginePhase is the final phase reached during the pump pass; if not supplied, the whole pass is executed.

Subsequent calls to this is different from pump in that it forces a full rebuild of the tree, even if widget is the same as the previous call. pump will only rebuild the widgets that have changed.

Source

Future<Null> pumpWidget(Widget widget, [
  Duration duration,
  EnginePhase phase = EnginePhase.sendSemanticsTree
]) {
  return TestAsyncUtils.guard(() {
    binding.attachRootWidget(widget);
    binding.scheduleFrame();
    return binding.pump(duration, phase);
  });
}