title: what is Key parameter in the constructor
body: <p>I'm doing the Udacity flutter course.
  There's this constructor call.</p>
  
  <pre><code>  child: Category(
      name: _categoryName,
      color: _categoryColor,
      iconLocation: _categoryIcon,
    ),
  </code></pre>
  
  <p>When I did this on my own, I naturally wrote the constructor as follows:</p>
  
  <pre><code> const Category({
      @required this.name,
      @required this.icon,
      @required this.color
    }) : assert(name != null),
        assert(icon != null),
        assert(color != null);
  </code></pre>
  
  <p>Disregard the asserts and @requireds. You call using three parameters, so the constructor must have three parameters.</p>
  
  <p>However, in the solution file of this exercise, the instructors did it like this.</p>
  
  <pre><code>  const Category({
      Key key,
      @required this.name,
      @required this.color,
      @required this.iconLocation,
    })  : assert(name != null),
          assert(color != null),
          assert(iconLocation != null),
          super(key: key);
  </code></pre>
  
  <p>What is this key parameter and why is the parent of the category widget class (StatelessWidget I presume) is being passed it?</p>
  
  <p>I have looked at <a href="https://docs.flutter.io/flutter/foundation/Key-class.html" rel="noreferrer">Key class</a>, but I did not understand anything. There's no context in this page or an example I can use.</p>