title: Flutter: complex json serialization. Parsing json string to provide into UI
body: <p>Here is the json string that I get by http request.
  The aim is to display subjects according to the current weekday.</p>
  
  <pre><code>{
      "first_name": "First Name",
      "batch_name": "Batch 1",
      "enrolled_subjects": [
          "Subject 4",
          "Subject 5"
      ],
      "batch_timetable": {
          "Mon": {
              "Subject 4": [
                  "6:00 PM - 7:00 PM"
              ],
              "Subject 5": [
                  "5:00 PM - 6:00 PM",
                  "7:00 PM - 8:00 PM"
              ],
              "Subject 6": [
                  "8:00 PM - 9:00 PM"
              ]
          },
          "Tue": {
              "Subject 4": [
                  "6:00 PM - 7:00 PM"
              ],
              "Subject 5": [
                  "7:00 PM - 8:00 PM"
              ],
              "Subject 6": [
                  "8:00 PM - 9:00 PM"
              ]
          }, ...so on upto "Sun"
      }
  }
  </code></pre>
  
  <p>How to set Model Class for this json string?</p>
  
  <p>I tried this Model Class but it gives this error : <code>type '_InternalLinkedHashMap&lt;dynamic, dynamic&gt;' is not a subtype of type 'Map&lt;String, List&lt;dynamic&gt;&gt;'</code></p>
  
  <p>I also tried Model Class by quicktype, but I think that won't work in this case.</p>
  
  <pre><code>class HomePageModel {
    HomePageModel({
      this.firstName,
      this.batchName,
      this.subjects,
      this.timetable,
    });
  
    String firstName;
    String batchName;
    List&lt;String&gt; subjects;
    Map timetable;
  
    factory HomePageModel.fromJson(Map&lt;String, dynamic&gt; json) =&gt; HomePageModel(
          firstName: json["first_name"],
          batchName: json["batch_name"],
          subjects: List&lt;String&gt;.from(json["subjects"].map((x) =&gt; x)),
          timetable: Map.from(json["timetable"])
              .map((key, value) =&gt; MapEntry(key, value)),
        );
  
    Map&lt;String, dynamic&gt; toJson() =&gt; {
          "first_name": firstName,
          "batch_name": batchName,
          "subjects": List&lt;dynamic&gt;.from(subjects.map((x) =&gt; x)),
          "timetable":
              Map.from(timetable.map((key, value) =&gt; MapEntry(key, value))),
        };
  }
  </code></pre>
  
  <p>I am using FutureBuilder to display this data into UI.
  Any help would be appreciated.</p>