toJson method
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());