title: use the same key for more than one widget in Flutter
body: <p>Hello StackOverFlow people,</p>
  <p>I am trying to use <strong>Keys</strong> in Flutter and I am doing well, however, there is something I am really missing, as we know using keys in Flutter is often less usage and rare, and when using keys, it should be unique to that widget and not repeatable, nonetheless, I found I can repeat the same key and use it twice, I can use it more than once, and the code below will explain what I mean.
  Any help will be appreciated. Thanks</p>
  <p><strong>This code does not allow me to use the same key more than once</strong></p>
  <pre><code> return Scaffold(
    appBar: AppBar(title: const Text(&quot;Local Key Example&quot;),),
    body: Column(
       children: [
         Text(&quot;One&quot;, key: ValueKey(1),),
         Text(&quot;Two&quot;, key: ValueKey(2),),
         Text(&quot;Three&quot;, key: ValueKey(1),)
      ],
    ),
  );
  </code></pre>
  <p><strong>But, this code will allow me to have two widgets with the same key and run with no Errors</strong></p>
  <pre><code>class _LocalKeyPageState extends State&lt;LocalKeyPage&gt; {
    List&lt;Widget&gt; myWidget=[
           const Text('First', key: ValueKey(1),),
          const Text(&quot;Second&quot;, key: ValueKey(2),),
          const Text(&quot;Third&quot;, key: ValueKey(3),),
          const Text(&quot;Fourth&quot;, key: ValueKey(2),),  ];
    @override
    Widget build(BuildContext context) {
     return Scaffold(
      appBar: AppBar(title: const Text(&quot;Local Key Example&quot;),),
      body: Column(
       children: myWidget.map((e) {
         if( e.key== ValueKey(2))
         { return Container(child: e, color: Colors.purple[300], width: 150,height: 50,);}
        return  Container(child: e,margin: EdgeInsets.all(10), color: Colors.amber,width: 200,height: 100,);
      }).toList(),
    ),
    floatingActionButton: FloatingActionButton(
      onPressed: (){
        setState(() {
          myWidget.removeWhere((element)
  
        {return element.key == ValueKey(2);});
        });
      },
      child: Icon(Icons.delete_forever),
    ),
  );
  
   }
   }
  </code></pre>