pump method

  1. @override
Future<void> pump (Duration duration)
override

Called to indicate that time should advance.

This is invoked by flingFrom, for instance, so that the sequence of pointer events occurs over time.

The WidgetTester subclass implements this by deferring to the binding.

See also SchedulerBinding.endOfFrame, which returns a future that could be appropriate to return in the implementation of this method.

Implementation

@override
Future<void> pump(Duration duration) async {
  if (duration != null)
    await Future<void>.delayed(duration);
  binding.scheduleFrame();
  await binding.endOfFrame;
}