toJSON method
Implementation
@override
dynamic toJSON(Object? object, SerializationContext context) {
dynamic convert(value) =>
value != null ? _transformValue(value, context) : null;
return (object is Iterable)
? object.map(convert).toList()
: convert(object);
}