toDict method
to map.
Implementation
Map<String, dynamic> toDict() {
Map<String, dynamic> d = {};
d['className'] = className;
d['version'] = version;
List<Map<String, dynamic>> seqList = [];
for (Nucleotide i in sequence) {
seqList.add(i.toDict());
}
d['sequence'] = seqList;
d['type'] = type.name;
d['id'] = id;
d['direction'] = direction.name;
d['description'] = description;
d['info'] = info;
Map<String, Map<String, dynamic>>? saveNInfo;
if (nucleotideInfo != null) {
saveNInfo = {};
for (String i in nucleotideInfo!.keys) {
saveNInfo[i] = nucleotideInfo![i]!.toDict();
}
}
d['nucleotideInfo'] = saveNInfo;
return d;
}