Json class

Implemented types


Json({bool anyMap, bool checked, bool createFactory, bool createToJson, bool disallowUnrecognizedKeys, bool explicitToJson, FieldRename fieldRename, bool ignoreUnannotated, bool includeIfNull, bool nullable})


anyMap bool
If true, Map types are not assumed to be Map<String, dynamic> – which is the default type of Map instances return by JSON decode in dart:convert. [...]
final, inherited
checked bool
If true, generated fromJson functions include extra checks to validate proper deserialization of types. [...]
final, inherited
createFactory bool
If true (the default), a private, static _$ExampleFromJson method is created in the generated part file. [...]
final, inherited
createToJson bool
If true (the default), A top-level function is created that you can reference from your class. [...]
final, inherited
disallowUnrecognizedKeys bool
If false (the default), then the generated FromJson function will ignore unrecognized keys in the provided JSON Map. [...]
final, inherited
explicitToJson bool
If true, generated toJson methods will explicitly call toJson on nested objects. [...]
final, inherited
fieldRename FieldRename
Defines the automatic naming strategy when converting class field names into JSON map keys. [...]
final, inherited
genericArgumentFactories bool
When true on classes with type parameters (generic types), extra "helper" parameters will be generated for fromJson and/or toJson to support serializing values of those types. [...]
final, inherited
hashCode int
The hash code for this object. [...]
read-only, inherited
ignoreUnannotated bool
When true, only fields annotated with JsonKey will have code generated. [...]
final, inherited
includeIfNull bool
Whether the generator should include fields with null values in the serialized output. [...]
final, inherited
nullable bool
When true (the default), null fields are handled gracefully when encoding to JSON and when decoding null and nonexistent values from JSON. [...]
final, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited


noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
toJson() Map<String, dynamic>
toString() String
A string representation of this object. [...]
withDefaults() JsonSerializable
Returns a new JsonSerializable instance with fields equal to the corresponding values in this, if not null. [...]


operator ==(Object other) bool
The equality operator. [...]