JSON class

abstract json object

Available Extensions

Constructors

JSON(dynamic obj)
Only support JSON types object.
JSON.parse(String jsonStr)
Parse json string as JSON object
factory

Properties

boolean bool?
Optional bool
no setter
booleanValue bool
Non-optional bool
no setter
ddouble double?
Optional double
no setter
ddoubleValue double
Non-optional double
no setter
error Error?
getter/setter pair
hashCode int
The hash code for this object.
no setteroverride
integer int?
Optional int
no setter
integerValue int
Non-optional int
no setter
isNull bool
Convenience method type == Type.nil
no setter
list List<JSON>?
Optional JSON
no setter
listObject List?
Optional dynamic
no setter
listValue List<JSON>
Non-optional JSON
no setter
map Map<String, JSON>?
Optional <String, JSON>{}
no setter
mapObject Map<String, dynamic>?
Optional <String, dynamic>{}
no setter
mapValue Map<String, JSON>
Non-optional <String, JSON>{}
no setter
number num?
Optional num
no setter
numberValue num
Non-optional num
no setter
rawJSONType Type
JSON Type
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
string String?
Optional string
no setter
stringValue String
Non-optional string
no setter
value ↔ dynamic
getter/setter pair

Methods

exist(String key) bool
if type is map && contains this key return true, otherwise return false
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
override
prettyString([String indent = ' ']) String
rawString() String
remove(String key) → void
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override
operator [](dynamic key) JSON
if key is String & type is map return json whose object is map[k] , otherwise return json.nil with error. if key is int & type is list return json whose object is list[k], otherwise return json.nil with error. if key is List<String/int> recursive aboves.
operator []=(dynamic key, dynamic dNewValue) → void
if key is String & type is map set map value if key is int & type is list set list value if key is List<String/int> recursive aboves.

Static Properties

nil JSON
getter/setter pair