This class converts JSON objects to strings.

Inheritance

Properties

indent String
read-only

The string used for indention.

Constructors

JsonEncoder([Object toEncodable(Object nonSerializable)])
const

Creates a JSON encoder.

JsonEncoder.withIndent(String indent, [Object toEncodable(Object nonSerializable)])
const

Creates a JSON encoder that creates multi-line JSON.

Methods

bind(Stream<Object> stream) → Stream<String>

Transform the incoming stream's events.

convert(Object object) → String

Converts object to a JSON String.

fuse(Converter<String> other) → Converter<Object>

Fuses this with other.

startChunkedConversion(Sink<String> sink) → ChunkedConversionSink<Object>

Starts a chunked conversion.