getStoryLengths function Null safety

List<int> getStoryLengths(
  1. List<StoryItem> storiesMapList
)

Implementation

List<int> getStoryLengths(List<StoryItem> storiesMapList) {
  List<int> intList = [];
  int count = 0;
  for (int i = 0; i < storiesMapList.length; i++) {
    count = count + storiesMapList[i].stories.length;
    intList.add(count);
  }
  return intList;
}