title: Multiple widgets used the same GlobalKey
body: <p>I'm using Flutter. I have a simple app with 3 tabs. There is a RefreshIndicator in each tab with a ListView. The rows are built in another method. 
  This is the code: </p>
  
  <pre><code> @override
   Widget build(BuildContext context) {
      final GlobalKey&lt;RefreshIndicatorState&gt; _RIKey1 = new GlobalKey&lt;RefreshIndicatorState&gt;();
      final GlobalKey&lt;RefreshIndicatorState&gt; _RIKey2 = new GlobalKey&lt;RefreshIndicatorState&gt;();
      final GlobalKey&lt;RefreshIndicatorState&gt; _RIKey3 = new GlobalKey&lt;RefreshIndicatorState&gt;();
  
      debugPrint(_RIKey1.toString());
      debugPrint(_RIKey2.toString());
      debugPrint(_RIKey3.toString());
      return new Scaffold(
        body: new DefaultTabController(
          length: 3,
          child: new Scaffold(
            appBar: new AppBar(
              bottom: new TabBar(
                tabs: [
                  new Tab(icon: new Icon(Icons.view_list)),
                  new Tab(icon: new Icon(Icons.hotel)),
                  new Tab(icon: new Icon(Icons.assessment)),
                ],
              ),
              title: new Text('Data'),
            ),
            body: new TabBarView(
              children: [
                new RefreshIndicator(
                  key: _RIKey1,
                  onRefresh: _actualizoData,
                  child: new ListView.builder(
                      padding: new EdgeInsets.only(top: 5.0),
                      itemCount: linea_reservas.length * 2,
                      itemBuilder: (BuildContext context, int position) {
                        if (position.isOdd) return new Divider();
                        final index = position ~/ 2;
                        return _buildRow(index);
                      }),
                ),
                new RefreshIndicator(
                  key: _RIKey2,
                  onRefresh: _actualizoData,
                  child: new ListView.builder(
                      padding: new EdgeInsets.only(top: 8.0),
                      itemCount: linea_inouthouse.length * 2,
                      itemBuilder: (BuildContext context, int position) {
                        if (position.isOdd) return new Divider();
                        final index = position ~/ 2;
                        return _buildRowInOutHouse(index);
                      }),
                ),
                new RefreshIndicator(
                  key: _RIKey3,
                  onRefresh: _actualizoData,
                  child: new ListView.builder(
                      padding: new EdgeInsets.only(top: 5.0),
                      itemCount: linea_ocupacion.length * 2,
                      itemBuilder: (BuildContext context, int position) {
                        if (position.isOdd) return new Divider();
                        final index = position ~/ 2;
                        return _buildRowOcupacion(index);
                      }),
                ),
              ],
            ),
          ),
        ),
      );
    }
  </code></pre>
  
  <p>I'd added the debugPrints and the output are 6 lines, instead of 3. </p>
  
  <pre><code>I/flutter ( 5252): [LabeledGlobalKey&lt;RefreshIndicatorState&gt;#4d76c]
  I/flutter ( 5252): [LabeledGlobalKey&lt;RefreshIndicatorState&gt;#59b9e]
  I/flutter ( 5252): [LabeledGlobalKey&lt;RefreshIndicatorState&gt;#2c88b]
  I/flutter ( 5252): [LabeledGlobalKey&lt;RefreshIndicatorState&gt;#7bd42]
  I/flutter ( 5252): [LabeledGlobalKey&lt;RefreshIndicatorState&gt;#1c984]
  I/flutter ( 5252): [LabeledGlobalKey&lt;RefreshIndicatorState&gt;#dbe20]
  </code></pre>
  
  <p><strong>the app works, but after changing tabs a few times, it crashes with this error:</strong> </p>
  
  <pre><code>    I/flutter ( 5252): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
  I/flutter ( 5252): The following assertion was thrown building NotificationListener&lt;KeepAliveNotification&gt;:
  I/flutter ( 5252): Multiple widgets used the same GlobalKey.
  I/flutter ( 5252): The key [LabeledGlobalKey&lt;RefreshIndicatorState&gt;#7bd42] was used by multiple widgets. The parents of
  I/flutter ( 5252): those widgets were:
  I/flutter ( 5252): - RepaintBoundary-[&lt;[LabeledGlobalKey&lt;RefreshIndicatorState&gt;#7bd42]&gt;](renderObject:
  I/flutter ( 5252):   RenderRepaintBoundary#60a4a DETACHED)
  I/flutter ( 5252): - RepaintBoundary-[&lt;[LabeledGlobalKey&lt;RefreshIndicatorState&gt;#7bd42]&gt;](renderObject:
  I/flutter ( 5252):   RenderRepaintBoundary#c8cdb NEEDS-LAYOUT NEEDS-PAINT)
  I/flutter ( 5252): A GlobalKey can only be specified on one widget at a time in the widget tree.
  </code></pre>
  
  <p>The keys are generated in the Build method, so, I don't understand why the <code>Multiple widgets used the same GlobalKey</code> error</p>
  
  <p>Why the key is generated again, and why it's not unique? I'm not talking of a thousand intents, the error appears after changing between tabs 4 or 5 times.
  Thank you for any help. </p>