createArray static method

List<Topic> createArray(
  1. dynamic topics
)

Get a list of topic

Implementation

static List<Topic> createArray(dynamic topics) {
  List<Topic> topicList = [];
  try {
    List<Object?> list = topics as List<Object?>;
    for (int i = 0; i < list.length; i++) {
      if (list[i] != null) {
        Topic? topic = new Topic(list[i] as Map);
        topicList.add(topic);
      }
    }
  } catch (ex) {
    print("exception createArray topics: " + ex.toString());
  }
  return topicList;
}