title: Cannot access map object with []. operator [] is not defined
body: <p>I am working on a mobile application using Flutter 1.7.8.</p>
  
  <p>I collected data from the server in a form of a nested json object, e.g. </p>
  
  <pre class="lang-dart prettyprint-override"><code>class Obj {
    final String obj_to_access;
    const Obj({this.obj_to_access});
    factory Obj.fromJson(Map&lt;String, dynamic&gt; json) {
      return Obj(
        obj_to_access: json['item']
      );
    }
  
  some_obj = 
  {
    "id": some_id,
    "nested_obj": Obj.fromJson(json["obj_to_access"])
  }
  </code></pre>
  
  <p>However, I can't seem to access the nested Obj with '[]' and it always give me this error: The operator '[]' isn't defined for the class 'Obj'. Try defining the operator.</p>
  
  <p>I saw that I should try defining the '[]' but I am not sure how. Please help thanks</p>