toJSON method
Implementation
@override
dynamic toJSON(Object? object, SerializationContext context) {
final format = getDateFormat(context.jsonPropertyMeta);
return format != null && object != null && object is! String
? format.format(object as DateTime)
: (object is List)
? object.map((item) => item.toString()).toList()
: object?.toString();
}