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 (AminoAcid i in sequence) {
seqList.add(i.toDict());
}
d['sequence'] = seqList;
d['id'] = id;
d['direction'] = direction.name;
d['description'] = description;
d['info'] = info;
Map<String, Map<String, dynamic>>? saveAAInfo;
if (aminoAcidInfo != null) {
saveAAInfo = {};
for (String i in aminoAcidInfo!.keys) {
saveAAInfo[i] = aminoAcidInfo![i]!.toDict();
}
}
d['aminoAcidInfo'] = saveAAInfo;
return d;
}