convertToJson static method

String convertToJson(
  1. dynamic data
)

Serialises data to a JSON string.

Throws JsonSerializationException when a value cannot be serialised, rather than returning the string "null" for the caller to cache.

Implementation

static String convertToJson(dynamic data) => json.encode(_encode(data));