toApiDictionary method
Converts a topic to map that can be sent to the APIs.
Implementation
Map<String, dynamic> toApiDictionary() {
Map<String, dynamic> dictionary = {
'code': code,
};
if (title != null) {
dictionary['title'] = title;
} else {
dictionary['title'] = code;
}
dictionary['single'] = single;
return dictionary;
}