decodedToJSON method
To JSON, only supports strings as map keys. Returns null if the conversion fails.
Implementation
String? decodedToJSON() {
String ret;
try {
ret = convertor.json.encode(getDecodedData());
} on Exception {
return null;
}
// Remove the [] from the JSON string
return ret.substring(1, ret.length - 1);
}