title: How to trigger an exception when accessing an invalid key from a map in Dart
body: <p>I am decoding a JSON string using Dart/Flutter, and I want to make sure that the resulting <code>Map</code> has all the keys I expect. </p>
  
  <pre><code>    return MyRecord(
          id: jsonObj['id'],
          name: jsonObj['name'],
          description: jsonObj['description']
      );
  </code></pre>
  
  <p>I thought I would get an exception if I tried to access a key that doesn't exist in the map, but Dart silently returns <code>null</code> instead. I guess I could simply use something like </p>
  
  <pre><code>    if( !(jsonObj.containsKey('id') 
         &amp;&amp; jsonObj.containsKey('name') 
         &amp;&amp; jsonObj.containsKey('description')) )
            throw new ArgumentError('Invalid JSON for converting to MyRecord: $jsonObj');
  </code></pre>
  
  <p>But I'm hoping there's a more convenient way to achieve what I want?</p>