title: Map Update method with ifAbsent in Dart
body: <p>I'd like to modify an existing item in a map, as in replace the value of an existing key with a new one, with an added clause if the key does not exist in the Map already, to simply create a new key and value pair. The Dart documentation suggests the update method for such a purpose, but I'm not quite sure about how to implement it with the optional ifAbsent() parameter, which I assume is a line of code called if the key to be updated does not exist. </p>
  
  <pre><code>V update(K key, V update(V value), {V ifAbsent()});
  </code></pre>
  
  <p>According to the documentation, there is an optional parameter to be taken, but it shows an error saying too many parameters, 2 expected but 3 found.</p>
  
  <p>This shows no error (not yet tested, but theoretically should work):</p>
  
  <pre><code>userData.update(key, value);
  </code></pre>
  
  <p>This (with the added create if not exist clause) does:</p>
  
  <pre><code>userData.update(key, value,
    userData[key] = value;
    );
  </code></pre>
  
  <p>Any help to get the latter or equivalent to work is much appreciated! I assume I'm missing something rather obvious here...</p>