0
0
Fluttermobile~20 mins

Page transition animations in Flutter - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Page Transition Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
ui_behavior
intermediate
2:00remaining
Which transition animation will slide the new page from the bottom?
Given the Flutter code below, which option correctly creates a page transition that slides the new page from the bottom of the screen?
Flutter
Navigator.of(context).push(PageRouteBuilder(
  pageBuilder: (context, animation, secondaryAnimation) => NewPage(),
  transitionsBuilder: (context, animation, secondaryAnimation, child) {
    // Choose the correct Tween here
    final tween = ???;
    final offsetAnimation = animation.drive(tween);
    return SlideTransition(position: offsetAnimation, child: child);
  },
));
ATween<Offset>(begin: Offset(0, -1), end: Offset.zero)
BTween<Offset>(begin: Offset(1, 0), end: Offset.zero)
CTween<Offset>(begin: Offset(0, 1), end: Offset.zero)
DTween<Offset>(begin: Offset(-1, 0), end: Offset.zero)
Attempts:
2 left
💡 Hint
Think about the Offset coordinates: (0, 1) means below the screen, (0, -1) means above.
lifecycle
intermediate
1:30remaining
When does the transition animation start in Flutter's PageRouteBuilder?
In Flutter, using PageRouteBuilder for custom page transitions, when does the transition animation begin?
AImmediately after Navigator.push is called
BAfter the new page's build method completes
COnly after the previous page is disposed
DWhen the user taps the screen
Attempts:
2 left
💡 Hint
Think about when Navigator.push triggers the route change.
📝 Syntax
advanced
1:30remaining
Identify the syntax error in this custom fade transition code
What is the syntax error in this Flutter PageRouteBuilder transitionsBuilder snippet?
Flutter
transitionsBuilder: (context, animation, secondaryAnimation, child) {
  return FadeTransition(
    opacity: animation,
    child: child,
  );
},
AMissing semicolon after return statement
BNo syntax error; code is correct
CtransitionsBuilder must return a Widget, but returns void
DFadeTransition requires a Tween animation, not animation directly
Attempts:
2 left
💡 Hint
Check the types expected by FadeTransition's opacity parameter.
🔧 Debug
advanced
2:00remaining
Why does the page not animate when using MaterialPageRoute?
A developer uses Navigator.push with MaterialPageRoute but sees no animation on page transition. What is the most likely cause?
AThe new page widget is not a StatefulWidget
BMaterialPageRoute requires a transitionsBuilder to animate
CNavigator.push must be called with a custom animation controller
DMaterialPageRoute uses default platform animation which may be subtle or disabled
Attempts:
2 left
💡 Hint
MaterialPageRoute uses platform default animations.
🧠 Conceptual
expert
2:30remaining
What is the effect of reversing the animation in a PageRouteBuilder transition?
In Flutter, if you reverse the animation parameter in the transitionsBuilder (e.g., using animation.drive(Tween).reverse()), what is the visual effect on the page transition?
AThe transition animation plays backward, causing the page to appear from the opposite direction
BThe animation does not run and the page appears instantly
CThe new page slides out instead of sliding in
DThe animation causes the previous page to fade out instead of the new page fading in
Attempts:
2 left
💡 Hint
Think about what reversing a Tween animation does to the movement direction.