title: Expected a value of type 'Map<String, dynamic>', but got one of type 'List<dynamic>'
body: <p>I am new to flutter and I am developing a web app using flutter Web and RESTful API for backend. Am trying to make a get Request, however I am getting an error &quot;Expected a value of type 'Map&lt;String, dynamic&gt;', but got one of type List&quot;,which have tried to debug based on the suggestions found here on stackOverflow but I can't seem to solve this issue. Here is a screenshot of the error am getting:
  <a href="https://i.stack.imgur.com/xocmF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xocmF.png" alt="enter image description here" /></a></p>
  <p>My API Response looks like this</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>{
    "page": 1,
    "pages": 1,
    "pageSize": 20,
    "totalRows": 3,
    "estates": [ {
      "id": "ccd442ae-471b-44c6-9eb3-e3c1dccab9f1",
      "name": "sarova group of hotels",
      "description": "An excuisite provider of luxury hotels and state–of–the–art apartments and villas.",
      "rating": 4,
      "city": {
        "id": "1a861a5a-e793-45cb-9a41-71c5b538da05", "name": "mogadishu", "country": "somalia", "countryISO": "so", "latitude": -1.286389, "longitude": 35.817223, "picture": "https://images.adsttc.com/media/images/5016/4cd3/28ba/0d14/1600/0340/slideshow/stringio.jpg"
      }
      ,
      "startingPricePerNight": 0,
      "checkInTime": "00:00:00",
      "checkOutTime": "00:00:00",
      "isVerified": false,
      "estateGroups": []
    }
    ,
    ]
  }</code></pre>
  </div>
  </div>
  </p>
  <p>And my API Response looks like this</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>Future &lt; List &lt; EstateSearch &gt;&gt; search(searchText, destination, rating, checkinDate,
    checkoutDate, adult, child, infant, rooms, travelPurpose, page) async {
    var searchUrl =
      "${ApiEndPoint.baseUrl}/estate?q=$searchText&amp;dest_type=$destination&amp;rating=$rating&amp;checkin_date=$checkinDate&amp;checkout_date=$checkoutDate&amp;no_adults=$adult&amp;no_children=$child&amp;no_infant=$infant&amp;no_rooms=$rooms&amp;travel_purpose=$travelPurpose&amp;page=$page";
    http.Response response = await http.get(
      Uri.parse(searchUrl),
      headers: {
        "Content-Type": "application/json"
      },
    );
    // print('ResonseBody' + '${response.body}');
    List &lt; EstateSearch &gt; estateList = [];
    var estates =
      (jsonDecode(response.body) as Map &lt; String, dynamic &gt; )["estates"];
    estateList = estates.map((i) =&gt; EstateSearch.fromJson(i)).toList();
    return estateList;
  }</code></pre>
  </div>
  </div>
  </p>
  <p>And the serialized model looks like this</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>class EstateSearch extends Paginator {
    String id;
    String name;
    String description;
    int rating;
    City city;
    double startingPricePerNight;
    String checkInTime;
    String checkOutTime;
    bool isVerified;
    EstateGroup estateGroups;
  
    EstateSearch({
      required this.id,
      required this.name,
      required this.description,
      required this.rating,
      required this.city,
      required this.startingPricePerNight,
      required this.checkInTime,
      required this.checkOutTime,
      this.isVerified = false,
      required this.estateGroups,
    });
    factory EstateSearch.fromJson(Map &lt; String, dynamic &gt; json) =&gt;
      _$EstateSearchFromJson(json);
    Map &lt; String, dynamic &gt; toJson() =&gt; _$EstateSearchToJson(this);
  }</code></pre>
  </div>
  </div>
  </p>