title: JSON associative array to Dart/Flutter object
body: <p>I have JSON response with the following object structure:</p>
  
  <pre><code>{
  "cities": {
      "5": {
          "id": "5",
          "name": "New York"
      },
      "6": {
          "id": "6",
          "name": "Los Angeles"
      }
  },
  "total": 2,
  "page": 1,
  "total_pages": 1
  }
  </code></pre>
  
  <p>As you can see, "cities" is clearly an associative type array that is listing all the cities being referenced. I'm trying to create a Dart object that can hold these cities values from a JSON object.
  The city object is pretty straightforward:</p>
  
  <pre><code>class City {
    int id;
    String name;
    City(this.id, this.name);
    City.fromJson(Map&lt;String, dynamic&gt; json) {
      id = json['id'];
      name = json['name'];
    }
  }
  </code></pre>
  
  <p>however, I'm not sure how to create the CityResults object. I usually create a List object from json arrays but I'm not sure how this would work?</p>