Dart API Reference
dart:convert
JsonCodec
JsonCodec
class
A
JsonCodec
encodes JSON objects to strings and decodes strings to JSON objects.
A
JsonCodec
encodes JSON objects to strings and decodes strings to JSON objects.
Extends:
Codec
<
Object
,
String
>
Object
Constructors
JsonCodec
( {
dynamic
reviver
(
key
,
value
)
,
dynamic
toEncodable
(
object
)
} )
const
Creates a JsonCodec with the given reviver and encoding function.
JsonCodec.withReviver
(
dynamic
reviver
(
key
,
value
)
)
Creates a JsonCodec with the given reviver.
Instance Properties
encoder
JsonEncoder
read-only
decoder
JsonDecoder
read-only
inverted
Codec
<
String
,
Object
>
Inherited
read-only
inverted
Codec
<
String
,
Object
>
Inherited
read-only
Instance Methods
decode
(
String
source
, {
dynamic
reviver
(
key
,
value
)
} ) →
dynamic
Parses the string and returns the resulting Json object.
encode
(
Object
value
, {
dynamic
toEncodable
(
object
)
} ) →
String
Converts value to a JSON string.
fuse
Inherited
(
Codec
<
String
>
other
) →
Codec
<
Object
>
Fuses this with other.
fuse
Inherited
(
Codec
<
String
>
other
) →
Codec
<
Object
>
Fuses this with other.