title: Flutter: InternalLinkedHashMap<String, dynamic>' has no instance method 'cast' with matching arguments
body: <p>I'm unable to find solutions from the previously available question, I have cast  <code>json</code> string to <code>map</code> </p>
  
  <p>Below is my API calling method.</p>
  
  <pre><code>Future&lt;EventResponse&gt; fetchEvent( ) async { // here i change Future type
  
   String url='http://xxxxxxxxxxxx.tk/api/userapp/event/lists';
  
   var headers = new Map&lt;String, String&gt;();//here i defined Map type
   headers['Auth-Key'] = 'OCDOC@2018';
   headers['End-Client'] = 'OCDOC';
  
   var body = new Map&lt;String, String&gt;();//here i defined Map type
   headers['schedule'] = 'present';
  
   http.Response res = await http.post(url,headers: headers, body: body);
  
   final parsed=json.decode(res.body);
   var myMap = Map&lt;String, dynamic&gt;.from(parsed);
   EventResponse eventResponse = EventResponse.convertEventResponse(myMap);
   return eventResponse;
  
  
   }
  </code></pre>
  
  <p>this is my <code>convertEventResponse</code> methode</p>
  
  <pre><code>factory EventResponse.convertEventResponse(Map&lt;String, dynamic&gt; json) {
      List&lt;dynamic&gt; events = json['eventList'];
      List&lt;Event&gt; eventList = events.map((e) =&gt; Event.convertEvent(e)).toList(); //here i changed by @Richard Heap answer
      return EventResponse(
        error: json['error'],
        status: json['status'],
        deliveryCharges: json['deliveryCharge'],
        imageBaseUrl: json['image_base_url'],
        imageLogoUrl: json['image_logo_url'],
        eventList: eventList,
      );
    }
  </code></pre>
  
  <p>The error i'm getting.</p>
  
  <blockquote>
  <pre><code>InternalLinkedHashMap&lt;String, dynamic&gt;' has no instance method 'cast' with matching arguments.
  </code></pre>
  </blockquote>