getNewsData static method

List<News> getNewsData(
  1. int count
)

Implementation

static List<News> getNewsData(int count) {
  List<News> items = [];
  for (int i = 0; i < count; i++) {
    News obj = new News();
    obj.image = all_images[random.nextInt(all_images.length)];
    obj.title = strings_medium[random.nextInt(strings_medium.length)];
    obj.subtitle = news_category[random.nextInt(news_category.length)];
    obj.date = full_date[random.nextInt(full_date.length)];
    items.add(obj);
  }
  return items;
}