title: Is it possible to call multiple APIs at one time
body: <p>I'm integrating some API in flutter, but I'm stuck. At one point on API, I need to pass data for the past 15 days, so on that basis I get a result. The issue is the loading time is too long now because I use a for loop and call one API, then the second API, then third and so on. What I'm looking for is can I call my 15 APIs together?</p>
  <p>My code</p>
  <pre><code>  getAllEvent() async {
      final storage = new FlutterSecureStorage();
  
      String asset_id = await storage.read(key: &quot;asset_id&quot;);
  
      var toDate = DateTime.now();
      var fromDate = toDate.subtract(Duration(days: 1));
      for (var i = 0; i &lt;= 15; i++) {
        // put them into a string
        final fromDateString =
            '${fromDate.year}-${fromDate.month}-${fromDate.day}';
        final toDateString = '${toDate.year}-${toDate.month}-${toDate.day}';
        final f = new DateFormat('yyyy-MM-dd');
        fromDate = fromDate.subtract(Duration(days: 1));
        toDate = toDate.subtract(Duration(days: 1));
  
        final url =
            'https://apihide/${asset_id}?start=${f.format(fromDate)}&amp;end=${f.format(toDate)}';
        // //print(url);
        // //print(ApiToken);
        http.Response res = await http.get(
          url,
          headers: &lt;String, String&gt;{'x-access-token': ApiToken},
        );
        var data = json.decode(res.body.toString());
        if (data['count'] &gt; 0) {
          eventList.eventListData.addAll(data['items']);
        }
      }
  
      setState(() {
        eventDataLoaded = true;
        checkDataLoaded();
      });
    }
  </code></pre>
  <p>You can see in code by for loop API is calling one by one. I need to call it 15 times in a single shot. (There is no issue in API if I hit 15 times at once because the API provider says to do this.)</p>