title: Push objects into array in Dart
body: <pre><code>  List returnMovies = [];
  
  Future&lt;List&gt; _getData() async {
  
      final response = await http.get("https:../getTodayMovies",
          headers: {HttpHeaders.AUTHORIZATION: Acess_Token.access_token});
  
  
      if (response.body != null) {
      returnMovies = json.decode(response.body);
        .....
  
        setState(() {});
      } else {
         final responseUpcoming = await http.get("/upcoming",
          headers: {HttpHeaders.AUTHORIZATION: Acess_Token.access_token});
          returnMovies = json.decode(responseUpcoming.body);
  
  
      }
  </code></pre>
  
  <p>The response.body looks like: </p>
  
  <pre><code>[{"id":394470548,"host_group_name":"heyab redda","movie_image":"..png","type":"horror","code":"X123","name":"Lovely","start_time":1554364800,"end_time":1554393600,"}]
  </code></pre>
  
  <p>The responseUpcoming.body looks like:</p>
  
  <pre><code> {"id":394470545,"host_group_name":"foo redda","movie_image":".png","type":"horror","code":"X123","name":"Lovely","start_time":1554364800,"end_time":1554393600,"}, {"id":394470548,"host_group_name":"foo1 redda","movie_image":"..png","type":"comic","code":"X125","name":"Lovely1","start_time":1554364800,"end_time":1554393600,"}
  </code></pre>
  
  <p>The error I get is: String, dynamic is not a subtype of type <code>List&lt;dynamic&gt;</code>.</p>
  
  <p>In the first API call that I am doing I normally get in return an array of objects, however, when this is empty, the second API call returns a list of objects that I want to push into the array called returnMovies, how can I achieve this?? Is there any way to .push these objects in the array?? So then I want to use this array to build dynamically a Listview.builder.
  Also is it correct the way I am declaring it? I am quite new on Dart. Thank you</p>