settle method
Wait for all animations, frame callbacks, and pending UI updates to complete.
A readable alias for pumpAndSettle. Use after actions that trigger navigation, animations, or state changes.
Example:
await tester.tap(find.byType(MyButton));
await tester.settle();
tester.assertNavigatedTo(ProfilePage.path);
Implementation
Future<void> settle({Duration? timeout}) async {
try {
await pumpAndSettle(timeout ?? const Duration(seconds: 5));
} catch (e) {
await pump(const Duration(milliseconds: 100));
await pump(const Duration(milliseconds: 100));
}
}