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
ismap
&& contains thiskey
returntrue
, otherwise returnfalse
-
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
isString
&type
ismap
return json whose object ismap[k]
, otherwise returnjson.nil
with error. ifkey
isint
&type
islist
return json whose object islist[k]
, otherwise returnjson.nil
with error. ifkey
isList<String/int>
recursive aboves. -
operator []=(
dynamic key, dynamic dNewValue) → void -
if
key
isString
&type
ismap
set map value ifkey
isint
&type
islist
set list value ifkey
isList<String/int>
recursive aboves.