Spec-Zone.ru › Dart 2

dart:convert

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 }]');
Inheritance
  • Object
  • Codec<Object?, String>
  • JsonCodec

Constructors

JsonCodec({Object? reviver(Object? key, Object? value)?, Object? toEncodable(dynamic object)?})
const
Creates a JsonCodec with the given reviver and encoding function.
JsonCodec.withReviver(dynamic reviver(Object? key, Object? value))
Creates a JsonCodec with the given reviver.

Properties

decoder → JsonDecoder
read-onlyoverride
Returns the decoder of this, converting from T to S.
encoder → JsonEncoder
read-onlyoverride
Returns the encoder from S to T.
hashCode → int
read-onlyinherited
The hash code for this object.
inverted → Codec<String, Object?>
read-onlyinherited
Inverts this.
runtimeType → Type
read-onlyinherited
A representation of the runtime type of the object.

Methods

decode(String source, {Object? reviver(Object? key, Object? value)?}) → dynamic
override
Parses the string and returns the resulting Json object.
encode(Object? value, {Object? toEncodable(dynamic object)?}) → String
override
Converts value to a JSON string.
fuse<R>(Codec<String, R> other) → Codec<Object?, R>
inherited
Fuses this with other.
noSuchMethod(Invocation invocation) → dynamic
inherited
Invoked when a non-existent method or property is accessed.
toString() → String
inherited
A string representation of this object.

Operators

operator ==(Object other) → bool
inherited
The equality operator.

© 2012 the Dart project authors
Licensed under the BSD 3-Clause "New" or "Revised" License.
https://api.dart.dev/stable/2.19.6/dart-convert/JsonCodec-class.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API