title: Flutter: Better way to use ObjectKeys?
body: <p>I am using a StatefulWidget whose constructor contains an Object, like</p>
  <pre><code>class X extends StatefulWidget {
    X({this.o});
    Object o;
  ...
  }
  </code></pre>
  <p>As it sometimes happens, this object <code>o</code> changes, but the widget <code>X</code> does not update, so I had to add an ObjectKey in the constructor:</p>
  <pre><code>class X extends StatefulWidget {
    X({this.o, this.key});
    Object o;
    ObjectKey key;
  ...
  }
  </code></pre>
  <p>Now every time I call the constructor, I have to call <code>X(o: o, key: ObjectKey(o));</code>. Is there a better way of doing this? It would be nice, if the constructor itself manages that, like</p>
  <pre><code>class X extends StatefulWidget {
    X({this.o, this.key = ObjectKey(o)});
    Object o;
    ObjectKey key;
  ...
  }
  </code></pre>
  <p>But as <code>ObjectKey(o)</code> is not a constant expression, it cannot be used as a default parameter. Is there another way?</p>