to map.
Map<String, dynamic> toDict() { Map<String, dynamic> d = {}; d['className'] = className; d['version'] = version; d['type'] = type.name; d['infoKey'] = infoKey; return d; }