toJson method
Implementation
toJson(value, TypeContext context) {
if (value == null)
return null;
List? list = value is List ? value : null;
var to = [];
if (list != null) {
for (var x in list) {
var converter = JsonConverters.resolve(getTypeName(x, context), context);
var item = converter.toJson(x, context);
to.add(item);
}
return to;
}
return value;
}