getNewsEndPoint static method

String getNewsEndPoint({
  1. required NewsType newsType,
  2. Language language = Language.en,
  3. int limit = 10,
})

Implementation

static String getNewsEndPoint({required NewsType newsType, Language language = Language.en, int limit = 10}) {
  if (newsType == NewsType.all_news || newsType == NewsType.trending || newsType == NewsType.top_stories) {
    return 'https://inshorts.com/api/${getLanguage(language)}/news?category=${getNewsType(newsType)}&max_limit=$limit&include_card_data=true';
  }
  return 'https://inshorts.com/api/${getLanguage(language)}/search/trending_topics/${getNewsType(newsType)}&max_limit=$limit&type=NEWS_CATEGORY';
}