serialize method
Implementation
@override
String serialize(dynamic object) {
dynamic parsedObject = _toMap(object, {});
if (parsedObject is String) {
return parsedObject;
}
dynamic cleanedUpObject = parsedObject;
// Beautify the JSON with indentation
if (prettyPrint) {
return const JsonEncoder.withIndent(' ').convert(cleanedUpObject);
} else {
return jsonEncode(cleanedUpObject);
}
}