title: Flutter Duplicate GlobalKeys detected in widget tree
body: <p>I am getting this error even though I have only one GlobalKey in my app. It is in my login screen. I have looked into the other solutions on StackOverflow, and it seems to be my login screen persisting. I am using CupertinoApp with a CupertinoTabView/CupertinoTabBar. Every thing is ok as long as I navigate within the tabs. But as soon as I navigate to a route over a tab, this error is thrown.</p>
  <h2>Latest Update</h2>
  <p>Further investigation has lead me to believe that the error has nothing to with the login GlobalKey,  and everything to do with the Navigator. The error does not trigger when I set rootNavigator to true. For example, <a href="https://youtu.be/MJmY4R0ARxk" rel="nofollow noreferrer">this is a video</a> of Transition to a screen with a StreamBuilder without the rootNavigator.</p>
  <p>The code:</p>
  <pre class="lang-dart prettyprint-override"><code>          Navigator.of(
            context,
            //rootNavigator: true,
          ).push&lt;void&gt;(
            CupertinoPageRoute(
              builder: (ctx) =&gt; MatchResultsScreen(widget.match),
            ),
          ),
  </code></pre>
  <p>The error is triggered but the screen is rendered correctly.</p>
  <p>Now here is a <a href="https://youtu.be/joN5CtsIc_w" rel="nofollow noreferrer">video of the rootNavigator set to true.</a></p>
  <p>The code:</p>
  <pre class="lang-dart prettyprint-override"><code>          Navigator.of(
            context,
            rootNavigator: true,
          ).push&lt;void&gt;(
            CupertinoPageRoute(
              builder: (ctx) =&gt; MatchResultsScreen(widget.match),
            ),
          ),
  </code></pre>
  <p>Now there is no error, but the streambuilder does not render unless I do a hot reload.</p>
  <p>This is clearly the cause of the issue. I have added a NavigatorState key each for the tabs. And each is rendered as a separate CupertinoTabView.</p>
  <p>Does anybody have any suggestions?</p>