UntypedJsonNode class

JsonNode to represent a JSON node of unknown type.

This JsonNode is not exposed as AST type because mapping to dynamic types is discouraged.

The use of this type is when converting a JSON String to a data class and/or extension methods. When a field is null then the type can not be determined.

Without a proper representation of this state it would be impossible to generate code for input containing null/unknown types.

Inheritance

Constructors

UntypedJsonNode({required String key, dynamic data})
Construct a new UntypedJsonNode.
const

Properties

annotations List<TypeAnnotation>
Metadata annotations which alter (de)serialization of this node.
finalinherited
data → dynamic
The JSON data of type T.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
key String
The JSON key (tag name).
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stringify String
Convert to formatted JSON String.
no setterinherited

Methods

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