title: When should we specify a Key parameter in Flutter widget constructors?
body: <p>I am very new to Flutter &amp; Dart. After reading some codes from several sources, I am wondering whether or not I should specify <code>Key key</code> parameter whenever I implement Flutter widget constructors. Some code I found do not use <code>Key key</code> parameter and other code extensively use it.</p>
  <p>The following snippet is copied from <a href="https://api.flutter.dev/flutter/widgets/StatelessWidget-class.html" rel="nofollow noreferrer">StatelessWidget class</a> section. It uses <code>Key key</code> parameter.</p>
  <pre><code>class Frog extends StatelessWidget {
    const Frog({
      Key key,
      this.color = const Color(0xFF2DBD3A),
      this.child,
    }) : super(key: key);
  
    final Color color;
    final Widget child;
  
    @override
    Widget build(BuildContext context) {
      return Container(color: color, child: child);
    }
  }
  </code></pre>
  <h1>Question</h1>
  <p>When should we specify a <code>Key</code> parameter in Flutter widget constructors?</p>