getStoryIds method

Future<List> getStoryIds()

Function used to access list of storyIds

Implementation

Future<List<dynamic>> getStoryIds() async {
  final response = await http.get(urlForStories(newsType));

  if (response.statusCode == 200) {
    dynamic storyIds = jsonDecode(response.body);

    return storyIds;
  } else {
    throw NewsException("Unable to fetch data! ${response.statusCode}");
  }
}