toJsonEncoded method

  1. @override
String toJsonEncoded({
  1. O? obj,
  2. JsonEncoder? jsonEncoder,
  3. bool pretty = false,
})
override

Returns a JSON encoded. See toJson.

Implementation

@override
String toJsonEncoded(
    {O? obj, JsonEncoder? jsonEncoder, bool pretty = false}) {
  obj ??= object;

  if (jsonEncoder == null) {
    var name = getName(obj);
    return dart_convert.json.encode(name);
  } else {
    return jsonEncoder.encode(obj, pretty: pretty);
  }
}