Flutter › Hero Animations & Page Transitions
How do you properly handle a Hero animation across a Navigator that genuinely spans several separate nested distinct navigators, such as one genuinely used together with a bottom tab bar navigation structure?
AdvancedAnswer
A Hero animation typically only genuinely works correctly when both the originating and destination widgets genuinely exist somewhere within that exact same single specific Navigator, and a genuinely more complex app structure using several separate nested navigators, such as one commonly used together with a bottom tab bar where each individual tab genuinely maintains its own entirely separate navigation stack, requires genuinely careful specific consideration, since a Hero transition attempting to span directly across two entirely separate distinct navigators generally will not actually properly work correctly by default, often requiring a considerably more careful restructuring of exactly where your particular navigation actually occurs, or an alternative different animation approach entirely instead.
// Hero animations generally require the origin and destination
// to genuinely both exist within the exact same single NavigatorReal-world example A team discovers their intended Hero animation was not actually genuinely working correctly at all specifically because their destination screen lived within an entirely separate distinct nested Navigator from their bottom tab bar structure, and properly restructures their own overall navigation to genuinely keep that specific transition properly contained fully within just one single shared Navigator instead.