fetchDailyEndpoint function

Future fetchDailyEndpoint(
  1. String endpoint, {
  2. bool chinese = false,
  3. Map kwargs = const {},
})

Implementation

Future fetchDailyEndpoint(String endpoint,
    {bool chinese = false, Map kwargs = const {}}) {
  var daily = chinese ? [CN_URL, CN_ACT_ID] : [OS_URL, OS_ACT_ID];

  var options = Map.of(kwargs);
  var params = Map.of(kwargs['params']);
  params['act_id'] = daily[1];
  options['params'] = params;
  var url = [daily[0], endpoint].join();

  return fetchEndpoint(url, chinese: chinese, kwargs: options);
}