createArray static method
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;
}