Justin McCandless
9b93519698
Route transition duration ( #171109 )
...
We need a robust way to get the duration of a route transition in tests,
so that tests can remain independent of the type of route transition and
its duration.
With this PR, this will be the canonical way to pump until a page
transition has finished:
```dart
testWidgets('example', (WidgetTester tester) async {
final TransitionDurationObserver observer = TransitionDurationObserver();
await tester.pumpWidget(
MaterialApp(
navigatorObservers: <NavigatorObserver>[observer],
onGenerateRoute: (RouteSettings settings) { ... },
),
);
expect(find.text('Page 1'), findsOneWidget);
expect(find.text('Page 2'), findsNothing);
// Pump through the whole transition.
await tester.tap(find.text('Next'));
await observer.pumpPastTransition(tester);
expect(find.text('Page 1'), findsNothing);
expect(find.text('Page 2'), findsOneWidget);
// Or, pump through part of a transition with the duration.
await tester.tap(find.text('Back'));
await tester.pump(observer.transitionDuration ~/ 2);
expect(find.text('Page 1'), findsOneWidget);
expect(find.text('Page 2'), findsOneWidget);
});
```
This was spun out of https://github.com/flutter/flutter/pull/165832 ,
where updating the default route transition and its duration broke tests
in the framework, in customer tests, and in Google tests.
FYI @chrisbobbe
---------
Co-authored-by: Jing Shao <87506348+jingshao-code@users.noreply.github.com>
2025-07-14 22:49:04 +00:00
..
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-04-09 03:31:31 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-09 21:22:48 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-01-25 05:50:26 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-07-10 21:10:37 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-14 22:49:04 +00:00
2024-12-19 20:06:21 +00:00
2025-06-09 15:01:53 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2025-07-02 21:46:09 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-06-25 19:12:23 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2024-12-30 18:31:41 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-07-14 22:49:04 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-01-14 05:13:41 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2025-01-14 05:13:41 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-14 22:49:04 +00:00
2025-07-14 22:49:04 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-01-14 05:13:41 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-03-05 17:41:20 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-05-29 17:30:32 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-06-16 18:40:00 +00:00
2025-05-27 19:39:24 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-02-06 03:08:23 +00:00
2025-02-06 03:08:23 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-02-06 03:08:23 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2025-02-06 03:08:23 +00:00
2025-06-12 21:26:00 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-04-29 20:58:29 +00:00
2025-04-29 20:58:29 +00:00
2025-04-29 20:58:29 +00:00
2025-04-29 20:58:29 +00:00
2025-04-29 20:58:29 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-01-22 21:52:11 +00:00
2025-06-17 18:37:11 +00:00
2025-07-10 03:17:13 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-07-02 21:46:09 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-06-17 18:37:11 +00:00
2025-07-07 17:58:32 +00:00
2025-05-23 00:02:01 +00:00
2025-07-07 17:58:32 +00:00
2025-07-08 16:53:24 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-10 22:32:31 +00:00
2025-07-07 17:58:32 +00:00
2025-07-08 17:18:58 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2025-03-12 23:30:16 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-02-05 20:51:29 +00:00
2024-12-19 20:06:21 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2025-07-07 17:58:32 +00:00
2024-12-19 20:06:21 +00:00
2025-07-07 17:58:32 +00:00