JsonCodec class final
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
- JsonCodec.new({Object? reviver(Object? key, Object? value)?, Object? toEncodable(dynamic object)?})
- 
          Creates a JsonCodecwith the given reviver and encoding function.const
- JsonCodec.withReviver(dynamic reviver(Object? key, Object? value))
- 
          Creates a JsonCodecwith the given reviver.
Properties
- decoder → JsonDecoder
- 
  Returns the decoder of this, converting fromTtoS.no setteroverride
- encoder → JsonEncoder
- 
  Returns the encoder from StoT.no setteroverride
- hashCode → int
- 
  The hash code for this object.
  no setterinherited
- 
  inverted
  → Codec<String, Object?> 
- 
  Inverts this.no setterinherited
- runtimeType → Type
- 
  A representation of the runtime type of the object.
  no setterinherited
Methods
- 
  decode(String source, {Object? reviver(Object? key, Object? value)?}) → dynamic 
- 
  Parses the string and returns the resulting Json object.
  override
- 
  encode(Object? value, {Object? toEncodable(dynamic object)?}) → String 
- 
  Converts valueto a JSON string.override
- 
  fuse<R> (Codec< String, R> other) → Codec<Object?, R> 
- 
  Fuses thiswithother.inherited
- 
  noSuchMethod(Invocation invocation) → dynamic 
- 
  Invoked when a nonexistent method or property is accessed.
  inherited
- 
  toString() → String 
- 
  A string representation of this object.
  inherited
Operators
- 
  operator ==(Object other) → bool 
- 
  The equality operator.
  inherited