serialize static method
Serializes the given object
into a JSON string using the provided options
.
Returns the serialized JSON string.
Implementation
static String serialize(Object? object, [JsonSerializerOptions? options]) {
final opts = JsonSerializer.options.merge(options);
return jsonEncode(object, toEncodable: (value) {
final type = DartParser.parseType(value.runtimeType.toString());
return encode(value, type, opts);
});
}