JsonObjectLite<E> class Null safety

JsonObjectLite allows .property name access to JSON by using noSuchMethod. The object is set to not immutable so properties can be added.

Implemented types


Default constructor. Creates a new empty map.
JsonObjectLite.fromJsonString(String jsonString, [JsonObjectLite? t, bool recursive = true])
Eager constructor parses jsonString using JsonDecoder. [...]


entries Iterable<MapEntry>
The map entries of this.
read-only, inherited
first → E
hashCode int
The hash code for this object. [...]
read-only, inherited
isEmpty bool
Whether there is no key/value pair in the map.
read-only, override
isImmutable bool?
isImmutable indicates if a new item can be added to the internal map via the noSuchMethod property, or the functions inherited from the map interface. [...]
read / write
isNotEmpty bool
Whether there is at least one key/value pair in the map.
read-only, override
iterator Iterator<E>
keys Iterable
The keys of this. [...]
read-only, override
last → E
length int
The number of key/value pairs in the map.
read-only, override
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
single → E
values Iterable
The values of this. [...]
read-only, override


addAll(dynamic items) → void
Adds all key/value pairs of other to this map. [...]
addEntries(Iterable<MapEntry> newEntries) → void
Adds all key/value pairs of newEntries to this map. [...]
any(bool f(dynamic element)) bool
Iterable implementation methods and properties
cast<RK, RV>() Map<RK, RV>
Provides a view of this map as having RK keys and RV instances, if necessary. [...]
clear() → void
If isImmutable is false, then allow the map to be cleared Throw JsonObjectLiteException if we're not allowed to clear.
contains(dynamic element) bool
containsKey(dynamic value) bool
Whether this map contains the given key. [...]
containsValue(dynamic value) bool
Map implementation methods and properties *
elementAt(int index) → E
every(bool f(dynamic element)) bool
expand<T>(dynamic f(dynamic element)) Iterable<T>
firstWhere(bool test(dynamic value), {dynamic orElse}) → dynamic
fold<T>(T initialValue, T combine(T a, dynamic b)) → T
forEach(void func(dynamic key, dynamic value)) → void
Applies action to each key/value pair of the map. [...]
join([String separator = '']) String
lastWhere(bool test(dynamic value), {dynamic orElse}) → dynamic
map<K2, V2>(MapEntry<K2, V2> convert(dynamic key, dynamic value)) Map<K2, V2>
Returns a new map where all entries of this map are transformed by the given convert function.
noSuchMethod(Invocation mirror) → dynamic
noSuchMethod() If we try to access a property using dot notation (eg: o.wibble ), then noSuchMethod will be invoked, and identify the getter or setter name. It then looks up in the map contained in _objectData (represented using this (as this class implements Map, and forwards it's calls to that class. If it finds the getter or setter then it either updates the value, or replaces the value. [...]
putIfAbsent(dynamic key, dynamic ifAbsent()) → void
If isImmutable is false, or the key already exists, then allow the edit. Throw JsonObjectLiteException if we're not allowed to add a new key
reduce(dynamic combine(dynamic value, dynamic element)) → dynamic
remove(dynamic key) → dynamic
If isImmutable is false, or the key already exists, then allow the removal. Throw JsonObjectLiteException if we're not allowed to remove a key
removeWhere(bool test(dynamic key, dynamic value)) → void
Removes all entries of this map that satisfy the given test.
singleWhere(bool test(dynamic value), {dynamic orElse}) → dynamic
skip(int n) Iterable<E>
take(int n) Iterable<E>
toIterable() Iterable?
Returns either the underlying parsed data as an iterable list (if the underlying data contains a list), or returns the map.values (if the underlying data contains a map).
toList({bool growable = true}) List
toSet() Set
toString() String
Returns a string representation of the underlying object data
update(dynamic key, dynamic update(dynamic value), {dynamic ifAbsent()?}) → dynamic
Updates the value for the provided key. [...]
updateAll(dynamic update(dynamic key, dynamic value)) → void
Updates all values. [...]
where(bool f(dynamic element)) Iterable<E>


operator ==(Object other) bool
The equality operator. [...]
operator [](dynamic key) → dynamic
The value for the given key, or null if key is not in the map. [...]
operator []=(dynamic key, dynamic value) → void
Specific implementations which check isImmtable to determine if an unknown key should be allowed. [...]

Static Methods

toTypedJsonObjectLite(JsonObjectLite src, JsonObjectLite dest) JsonObjectLite
Typed JsonObjectLite


decoder → const JsonDecoder
JSON decoder
encoder → const JsonEncoderLite
JSON encoder, use our encoder not the one from convert