@@ -1002,8 +1002,8 @@ steps:
10021002 - name : Use PageRouteBuilder
10031003 path : quiz/lib/home_screen.dart
10041004 patch-u : |
1005- --- a /animations/step_05 /lib/home_screen.dart
1006- +++ b /animations/step_05 /lib/home_screen.dart
1005+ --- b /animations/step_05_a /lib/home_screen.dart
1006+ +++ a /animations/step_05_a /lib/home_screen.dart
10071007 @@ -26,14 +26,19 @@ class HomeScreen extends StatelessWidget {
10081008 // Show the question screen to start the game
10091009 Navigator.push(
@@ -1015,9 +1015,9 @@ steps:
10151015 - ),
10161016 + PageRouteBuilder(
10171017 + pageBuilder: (context, animation, secondaryAnimation) {
1018- + return const QuestionScreen();
1019- + }, transitionsBuilder:
1020- + (context, animation, secondaryAnimation, child) {
1018+ + return const QuestionScreen();
1019+ + }, transitionsBuilder:
1020+ + (context, animation, secondaryAnimation, child) {
10211021 + return FadeTransition(
10221022 + opacity: animation,
10231023 + child: child,
@@ -1039,17 +1039,17 @@ steps:
10391039 - name : Use package:animations FadeThroughTransition
10401040 path : quiz/lib/home_screen.dart
10411041 patch-u : |
1042- --- a /animations/step_05 /lib/home_screen.dart
1043- +++ b /animations/step_05 /lib/home_screen.dart
1042+ --- b /animations/step_05_b /lib/home_screen.dart
1043+ +++ a /animations/step_05_b /lib/home_screen.dart
10441044 @@ -1,3 +1,4 @@
10451045 +import 'package:animations/animations.dart';
10461046 import 'package:flutter/material.dart';
10471047 import 'question_screen.dart';
10481048
10491049 @@ -31,8 +32,9 @@ class HomeScreen extends StatelessWidget {
1050- return const QuestionScreen();
1051- }, transitionsBuilder:
1052- (context, animation, secondaryAnimation, child) {
1050+ return const QuestionScreen();
1051+ }, transitionsBuilder:
1052+ (context, animation, secondaryAnimation, child) {
10531053 - return FadeTransition(
10541054 - opacity: animation,
10551055 + return FadeThroughTransition(
@@ -1093,8 +1093,8 @@ steps:
10931093 - name : Change back to MaterialPageRoute
10941094 path : quiz/lib/home_screen.dart
10951095 patch-u : |
1096- --- a /animations/step_05 /lib/home_screen.dart
1097- +++ b /animations/step_05 /lib/home_screen.dart
1096+ --- b /animations/step_05_c /lib/home_screen.dart
1097+ +++ a /animations/step_05_c /lib/home_screen.dart
10981098 @@ -1,4 +1,3 @@
10991099 -import 'package:animations/animations.dart';
11001100 import 'package:flutter/material.dart';
@@ -1106,16 +1106,15 @@ steps:
11061106 context,
11071107 - PageRouteBuilder(
11081108 - pageBuilder: (context, animation, secondaryAnimation) {
1109- - return const QuestionScreen();
1110- - }, transitionsBuilder:
1111- - (context, animation, secondaryAnimation, child) {
1109+ + MaterialPageRoute(builder: (context) {
1110+ return const QuestionScreen();
1111+ - }, transitionsBuilder:
1112+ - (context, animation, secondaryAnimation, child) {
11121113 - return FadeThroughTransition(
11131114 - animation: animation,
11141115 - secondaryAnimation: secondaryAnimation,
11151116 - child: child,
11161117 - );
1117- + MaterialPageRoute(builder: (context) {
1118- + return const QuestionScreen();
11191118 }),
11201119 );
11211120 },
0 commit comments