pumpAndSettle method
Pump the widget tree and wait for animations to complete.
Implementation
Future<void> pumpAndSettle({Duration? timeout}) async {
final end = clock.now().add(timeout ?? const Duration(seconds: 10));
do {
if (clock.now().isAfter(end)) {
throw Exception('pumpAndSettle timed out');
}
await pump();
} while (_binding.hasScheduledFrame);
}