JsonPayload class

A mutable Json payload that enforce it'll always be able to json encode it's content

Inheritance

Constructors

JsonPayload()
JsonPayload.from(Json other, {bool initial = true})
JsonPayload.fromDynamic(dynamic rawValue, {bool initial = true})
JsonPayload.fromList(List list, {bool initial = true})
JsonPayload.fromMap(Map<String, dynamic> map, {bool initial = true})
JsonPayload.fromString(String json)

Properties

boolean bool?
Returns a bool or null if rawValue is not a bool
no setterinherited
booleanValue bool
Returns a bool or false if rawValue is not thruthy
no setterinherited
exception JsonException?
Exceptions are never thrown, instead they are silently stored in the Json instance
getter/setter pairinherited
float double?
no setterinherited
floatValue double
Returns a double 0 if rawValue is not a double
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
integer int?
Returns a int or null if rawValue is not a int
no setterinherited
integerValue int
Returns a int or 0 if rawValue is not a int
no setterinherited
jsonNull JsonPayload
Create a Json with a null rawValue
no setteroverride
list List<JsonPayload>?
Returns a List or null if rawValue is not a List Each element of the list is wrapped in a Json instance
no setteroverride
listObject List?
Returns a List or null if rawValue is not a List Leaves list items untouched
no setterinherited
listObjectValue List
Returns a List or an empty List if rawValue is not a List Leaves list items untouched
no setterinherited
listValue List<JsonPayload>
Returns a List or an empty List if rawValue is not a List Each element of the list is wrapped in a Json instance
no setteroverride
map Map<String, JsonPayload>?
Returns a Map or null if rawValue is not a Map Each value of the map is wrapped in a Json
no setteroverride
mapObject Map<String, dynamic>?
Returns a Map or null if rawValue is not a Map Leaves map values untouched
no setterinherited
mapObjectValue Map<String, dynamic>
Returns a Map of T or empty Map if rawValue is not a Map of T Leaves map values untouched
no setterinherited
mapValue Map<String, JsonPayload>
Returns a Map or an empty Map if rawValue is not a Map Each value of the map is wrapped in a Json
no setteroverride
rawValue ↔ dynamic
Actual value
getter/setter pairinherited-getter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
string String?
Returns a String or null if rawValue is not a String
no setterinherited
stringValue String
Returns a String or an empty String if rawValue is not a String
no setterinherited

Methods

exists([dynamic key]) bool
Returns true if exception is null
inherited
listOf<T>([T? builder(dynamic)?]) List<T>?
Returns a List of T or empty list if rawValue is not a List of T If actual data is not a List of T, calls builder to get one
inherited
listOfValue<T>([T? builder(dynamic)?]) List<T>
Returns a List of T or an empty List if rawValue is not a List of T If actual data is not a List of T, calls builder to get one
inherited
mapOf<T>([T? builder(dynamic)?]) Map<String, T>?
Returns a Map of T or null if rawValue is not a Map of T If actual data is not a Map of T, calls builder to get one
inherited
mapOfValue<T>() Map<String, T>?
Returns a List of T or empty Map if rawValue is not a List of T If actual data is not a List of T, calls builder to get one
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
ofType<T>([T? builder(dynamic)?]) → T?
Returns a T or null if rawValue is not a T If actual data is not T, calls builder to get one
inherited
ofTypeValue<T>(T defaultValue, [T? builder(dynamic)?]) → T
Returns a T or defaultValue if rawValue is not a T If actual data is not T, calls builder to get one
inherited
removeElementWithKey(dynamic key) → void
Remove element under key
toJson() → dynamic
inherited
toString() String
Returns actual Json
inherited

Operators

operator ==(Object other) bool
Compare Json by instance or by value
inherited
operator [](dynamic key) JsonPayload
Returns a Json wrapping the data under key. If key does not exist, returns a empty Json instance with an exception
override
operator []=(dynamic key, dynamic value) → void