serialize function
Implementation
String serialize(dynamic obj) => json.encode(
obj,
toEncodable: (e) {
try {
return e.json;
} on NoSuchMethodError catch (_) {
print("Error: '${e.runtimeType}' has no property 'json'!");
return null;
}
},
);