JsonCodec class
A JsonCodec encodes JSON objects to strings and decodes strings to JSON objects.
Examples:
var encoded = json.encode([1, 2, { "a": null }]);
var decoded = json.decode('["foo", { "bar": 499 }]');
Constructors
Properties
- decoder → JsonDecoder
-
Returns the decoder of
this
, converting fromT
toS
. [...]read-only, override - encoder → JsonEncoder
-
Returns the encoder from
S
toT
. [...]read-only, override - hashCode → int
-
The hash code for this object. [...]
read-only, inherited
-
inverted
→ Codec<
String, Object> -
Inverts
this
. [...]read-only, inherited - runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Methods
-
decode(
String source, { dynamic reviver(Object key Object value) }) → dynamic -
Parses the string and returns the resulting Json object. [...]
override
-
encode(
Object value, { dynamic toEncodable(dynamic object) }) → String -
Converts
value
to a JSON string. [...]override -
fuse<
R> (Codec< String, R> other) → Codec<Object, R> -
Fuses
this
withother
. [...]inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
-
toString(
) → String -
Returns a string representation of this object.
inherited
Operators
-
operator ==(
dynamic other) → bool -
The equality operator. [...]
inherited