title: Is there shorthand assign value to map in dart?
body: <pre><code>var save({height, name}) {
        Map&lt;String, dynamic&gt; data = {};
        var setData = (map, key, data) {
          if (data != null) {
            map[key] = data;
          }
        };
        setData(data, 'height', height);
        setData(data, 'name', name);
        return data;
  }
  </code></pre>
  
  <p>I want to make function that not acceptable null value on map.</p>
  
  <pre><code>save(height: 123); // want { height: 123 } NOT { height: 123, name: null }
  </code></pre>
  
  <p>I think that code is silly or too much.</p>
  
  <p>I usally write javascript.
  Is that right code for dart?</p>