title: Flutter widget class with the same name share the same instance unexpectedly
body: <p>I am trying to create 3 tab screens (say screenA, screenB and screenC) and each screen need to have their own navigator.</p>
  
  <pre><code>class TabNavigator extends StatefulWidget {
    final int tabID;
    TabNavigator({this.tabID});
  
    @override
    _TabNavigatorState createState() =&gt; _TabNavigatorState();
  }
  
  class _TabNavigatorState extends State&lt;TabNavigator&gt; {
    @override
    Widget build(BuildContext context) {
      return new Navigator(
        initialRoute: "/",
        onGenerateRoute: (RouteSettings settings) {
          switch (settings.name) {
            case '/':
            default:
              if(widget.tabID == 1) {
                return CupertinoPageRoute(
                    builder: (_) =&gt; ScreenA(), settings: settings);
              }
              else if(widget.tabID == 2) {
                return CupertinoPageRoute(
                    builder: (_) =&gt; ScreenB(), settings: settings);
              }
              else {
                return CupertinoPageRoute(
                    builder: (_) =&gt; ScreenC(), settings: settings);
              }
          }
        },
      );
    }
  }
  </code></pre>
  
  <p>And here is the code of my TabView. When the tabID is changed, the <code>print(widget.tabID);</code> can successfully print out the correct tabID.</p>
  
  <pre><code>class TabView extends StatefulWidget {
  
    final int tabID;
  
    TabView({
      this.tabID
    });
  
    @override
    _TabViewState createState() =&gt; _TabViewState();
  }
  
  class _TabViewState extends State&lt;TabView&gt; {
  
    Map&lt;int, Widget&gt; tabViews   = {
      1: new TabNavigator(tabID: 1),
      2: new TabNavigator(tabID: 2),
      3: new TabNavigator(tabID: 3)
    };
  
    @override
    Widget build(BuildContext context) {
      print(widget.tabID);  
      switch(widget.tabID) {
        case 1:
        case 2:
        case 3:
          return tabViews[widget.tabID];
          break;
        default:
          return tabViews[1];
          break;
      }
    }
  }
  </code></pre>
  
  <p>However, the problem is that <code>onGenerateRoute</code> in TabNavigator will be only called once (I expect it should be called 3 times). As a result, no matter how the tab (tabID) is changed, the initial route of the navigator is always directed to <code>ScreenA()</code>.</p>
  
  <p>The only way I can make it works is to duplicate the <code>TabNavigator</code> to <code>TabNavigatorA</code>, <code>TabNavigatorB</code> and <code>TabNavigatorC</code> but I quite sure there should be some other ways to do it.</p>