toJson method

  1. @override
String toJson({
  1. JsonCodec codec = const JsonCodec(),
})
override

Returns a JSON-encoded string representation of the object.

The optional codec parameter specifies the JSON codec to use for encoding the object (defaults to JsonCodec()).

Implementation

@override
String toJson({JsonCodec codec = const JsonCodec()}) => codec.encode(toMap());