Skip to content

CupertinoNavigationBar crashes with multiple Navigators #25218

@brettpappas

Description

@brettpappas

Example code:
https://github.com/brettpappas/cupertion_navbar/blob/master/lib/main.dart

This dart file includes a CupertinoTabScaffold layout with a side menu using Drawer. Everything works fine opening the Modal Window in the Drawer and opening sub-screens from CupertinoTabView as long as you return each tabview back to the root navigation stack.

I understand the error and still can't get it to work even if I use heroTag unless I set a different heroTag for the sub-screen and the main screen which prevents those two from transitioning between each other.

The problem happens when you do the following:

Steps to Reproduce

  1. Select tab Two and then tap on the button "Two: Sub Screen".
  2. Leave it on the sub screen and switch over to tab One.
  3. Tap on the hamburger menu in the top left to open the Drawer and tap on Modal Window.

Logs

flutter: There are multiple heroes that share the same tag within a subtree.
flutter: Within each subtree for which heroes are to be animated (typically a PageRoute subtree), each Hero
flutter: must have a unique non-null tag.
flutter: In this case, multiple heroes had the following tag: Default Hero tag for Cupertino navigation bars
flutter: with navigator NavigatorState#fc127(tickers: tracking 2 tickers)
[✓] Flutter (Channel beta, v1.0.0, on Mac OS X 10.14.2 18C54, locale en-US)
    • Flutter version 1.0.0 at /internet/tools/flutter
    • Framework revision 5391447fae (12 days ago), 2018-11-29 19:41:26 -0800
    • Engine revision 7375a0f414
    • Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)

[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
    • Android SDK at /Users/122999/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • ANDROID_HOME = /Users/122999/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.1, Build version 10B61
    • ios-deploy 1.9.4
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 29.1.1
    • Dart plugin version 181.5656
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)

[✓] VS Code (version 1.29.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 2.21.1

[✓] Connected device (1 available)
    • iPhone X • C244B63B-3DDC-4F46-8440-87E3FF8E8B74 • ios • iOS 12.1 (simulator)

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: crashStack traces logged to the consolef: cupertinoflutter/packages/flutter/cupertino repositoryf: routesNavigator, Router, and related APIs.frameworkflutter/packages/flutter repository. See also f: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions