Skip to content

iOS: a Hero inside a nested Navigator never flies #103

Backlog

Description

@tayormi

Select your plan

Standard - priority support

Confirmations

  • I searched the existing issues and this is not a duplicate.

Framework or plugin?

Framework

Plugin name and version

No response

Platform

iOS

Public reproduction repo

https://github.com/tayormi/dn-issue-repros

Steps to reproduce

Two Heros with the same tag fly when the push is on the app's own stack, but not when the push is on a Navigator widget (the per-tab navigator the Navigator docs suggest: "give each tab one to keep a stack per tab"). Nothing warns, and the Hero docs don't mention it.

Setup, all in lib/repros/01_hero_nested_navigator.dart: the screen's body is a Navigator widget, with a grey strip under it standing in for the tab bar. Its first page has a small square in a Hero. Both buttons push a page with a big square in a Hero of the same tag, with RouteTransition.fade over 1.5 s.

  1. Clone the reproduction repo linked above and run dn run on an iOS simulator (seen on the iPhone Air, iOS 26.5 simulator).
  2. Tap 01 Hero in a nested Navigator.
  3. Control: tap Push on the app's stack (works). The small square flies and grows into the big one while the page fades in. Tap Back.
  4. Tap Push in this Navigator (bug).
  5. Observe: nothing flies. The page slides in from the right with the big square already in place, and the small square stays on the page being covered. (The slide instead of the fade is a separate issue, filed on its own: a nested Navigator ignores the route's transition, iOS: a nested Navigator ignores the route's transition (none, fade, PageRouteBuilder) #104.)

Expected: the square flies, as in step 3.

Also: after step 4, tap Back, then Push on the app's stack again. It no longer flies either; the big square only fades in. It looks as if the nested pages register their Heroes on the same route as the screen that holds the Navigator, so the nested push and pop overwrite and then remove the small square's registration.

In a real app this rules out shared-element transitions in any tabbed app: a list item's image can't grow into the detail page that opens in the same tab. Our workaround is a hand-built overlay "flight" with a cover that hides the slide, which is a lot of code for what Hero should do.

Screenshots or video

Control: app's stack, mid-flight Bug: nested Navigator, mid-push
App's stack, mid-flight Nested Navigator, no flight

Logs

No response

dn doctor output

[!] DartNative (Channel stable, 1.10.0, on macOS 26.6 25G72 darwin-arm64, locale en-CA) [499ms]
    • DartNative version 1.10.0 on channel stable at ~/zero
    ! Warning: `flutter` on your path resolves to ~/Flutter/flutter/bin/flutter, which is not inside your current DartNative SDK checkout at ~/zero. Consider adding ~/zero/bin to the front of your path.
    ! Warning: `dart` on your path resolves to ~/Flutter/flutter/bin/dart, which is not inside your current DartNative SDK checkout at ~/zero. Consider adding ~/zero/bin to the front of your path.
    • Downloaded from https://cdn.dartnative.com; "dn upgrade" moves it to the newest release, "dn releases" lists the others
    • Framework revision bdfb466e6d1 (4 days ago), 2026-11-24 15:36:11 +0100
    • Framework edition b2263be6a0167213
    • Engine revision de099f669f
    • Dart version 3.12.0 (build 3.12.0-192.0.dev)
    • DevTools version 2.55.0
    • DartNative download mirror https://cdn.dartnative.com
    • Feature flags: enable-android, enable-ios, cli-animations, enable-native-assets, enable-lldb-debugging, enable-uiscene-migration
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[!] Xcode - develop for iOS and macOS (Xcode 27.2) [938ms]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 27B52
    ! iOS 27.2 Simulator not installed; this may be necessary for iOS and macOS development.
      To download and install the platform, open Xcode, select Xcode > Settings > Components,
      and click the GET button for the required platform.

      For more information, please visit:
        https://developer.apple.com/documentation/xcode/installing-additional-simulator-runtimes
    • CocoaPods version 1.16.2

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions