toJson static method
Converts value into JSON string.
value
the value to convert. Returns JSON string or null when value is null.
Implementation
static String? toJson(value) {
if (value == null) return null;
return jsonEncode(value, toEncodable: _toEncodable);
}