A. The logo image will smoothly animate from Screen A to Screen B, changing size
B. No animation will occur because the images are different
C. The app will crash due to tag conflict
D. The Hero animation will flicker and not complete
Solution
Step 1: Understand Hero tag matching
Hero animations link widgets with the same tag, regardless of child widget differences.
Step 2: Predict animation behavior
The image will animate smoothly from the smaller to the larger version because the tag matches.
Final Answer:
The logo image will smoothly animate from Screen A to Screen B, changing size -> Option A
Quick Check:
Matching tags animate widgets smoothly [OK]
Hint: Same tag triggers animation even if child widgets differ [OK]
Common Mistakes:
Assuming images must be identical for animation
Thinking different children cause crashes
Expecting no animation if child changes
4. What is wrong with this Hero animation code?
Hero(tag: 'avatar', child: Container(color: Colors.blue))
// On next screen
Hero(tag: 'avatar', child: Container(color: Colors.red))
medium
A. The child widgets are not wrapped in Material widgets
B. The Hero animation will fail because Container has no size
C. The Hero widgets have different tags
D. Nothing is wrong; this code works correctly
Solution
Step 1: Check Hero child widget requirements
Hero animations require child widgets to have a defined size to animate properly.
Step 2: Analyze Container usage
Container with only color but no size defaults to zero size, causing animation failure.
Final Answer:
The Hero animation will fail because Container has no size -> Option B
Quick Check:
Hero child needs size to animate [OK]
Hint: Ensure Hero child widgets have size for animation [OK]
Common Mistakes:
Thinking tag mismatch causes error here
Assuming Material widget is always required
Ignoring size requirement of Hero child
5. You want to create a Hero animation for a profile picture that appears in a list and on a detail page. The list shows a small circular avatar, and the detail page shows a larger square image. How should you implement the Hero widgets to ensure a smooth animation?
hard
A. Use different tags for each Hero widget to avoid conflicts
B. Use the same tag but keep both images circular to match shapes exactly
C. Wrap both Hero widgets in Material widgets with different elevation values
D. Use the same tag on both Hero widgets; wrap the small avatar in a ClipOval and the large image in a ClipRRect with border radius zero
Solution
Step 1: Use matching tags for Hero animation
Both Hero widgets must share the same tag to link the animation.
Step 2: Handle shape differences smoothly
Wrap the small avatar in ClipOval for circle shape and the large image in ClipRRect with zero border radius for square shape to animate shape change smoothly.
Final Answer:
Use the same tag on both Hero widgets; wrap the small avatar in a ClipOval and the large image in a ClipRRect with border radius zero -> Option D
Quick Check:
Same tag + shape wrappers = smooth Hero animation [OK]
Hint: Match tags and wrap widgets to animate shape changes [OK]
Common Mistakes:
Using different tags breaks animation
Ignoring shape differences causes jumpy animation
Assuming Material widget fixes shape issues
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.