Skip to content

Commit 69b0968

Browse files
mdebbarspydon
andauthored
test: Update game_widget_lifecycle_test for material_ui 1.8.0 (#4125)
`material_ui` 1.8.0 (flutter/packages#13161) enabled route-transition raster snapshotting ([`allowSnapshotting = true`](https://github.com/flutter/packages/blob/623479c2ee9209316460eafb3f3cff61367127a0/packages/material_ui/lib/src/page_transitions_theme.dart#L590-L607)) in `FadeForwardsPageTransitionsBuilder` on Android, matching `ZoomPageTransitionsBuilder`. In `game_widget_lifecycle_test.dart`, when `tester.tap(find.text('Play'))` pumps a second frame 16ms into the `/game` route transition, `SnapshotWidget` reuses the raster snapshot captured on the first transition frame instead of calling `GameRenderBox.paint` a second time. Example CI failures: - https://ci.chromium.org/b/8667404745333857041 - https://ci.chromium.org/b/8667406041351366033 This disables route-transition snapshotting via `FadeForwardsPageTransitionsBuilder(allowSnapshotting: false)` in `_MyApp` so the game continues rendering live during the transition. Part of flutter/flutter#194883 --------- Co-authored-by: Lukas Klingsbo <[email protected]>
1 parent 0fd62f6 commit 69b0968

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎packages/flame/test/game/game_widget/game_widget_lifecycle_test.dart‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,15 @@ class _MyApp(final List<String> events) extends StatelessWidget {
112112
@override
113113
Widget build(BuildContext context) {
114114
return MaterialApp(
115+
theme: ThemeData(
116+
pageTransitionsTheme: const PageTransitionsTheme(
117+
builders: {
118+
TargetPlatform.android: FadeForwardsPageTransitionsBuilder(
119+
allowSnapshotting: false,
120+
),
121+
},
122+
),
123+
),
115124
routes: {
116125
'/': (_) => const _TitlePage(),
117126
'/game': (_) => _GamePage(game),

0 commit comments

Comments
 (0)