serialize method

String serialize (
  1. Object object,
  2. [SerializationOptions options = defaultSerializationOptions]
)

Converts Dart object to JSON string

Implementation

static String serialize(Object object,
    [SerializationOptions options = defaultSerializationOptions]) {
  final context = SerializationContext(options);
  instance.processedObjects.clear();
  return _getJsonEncoder(context)
      .convert(instance.serializeObject(object, context));
}