ModelLess class

The ModelLess class is a dynamic, flexible data structure designed to handle nested data structures and perform common operations such as accessing, setting, and manipulating data within the structure. This class is particularly useful in scenarios where you need to work with JSON-like data structures that may contain nested maps or lists. Below is a detailed breakdown of the key features and methods in the ModelLess class.

Constructors

ModelLess({Map<String, dynamic>? fields, dynamic onGet(dynamic value)?})
ModelLess.fromDynamic(dynamic val)
factory
ModelLess.fromJson(String jsonString)
making a new model from a json string
factory
ModelLess.fromMap(Map map)
making a new model from a map
factory

Properties

fields Map<String, dynamic>
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
onGet ↔ dynamic Function(dynamic value)?
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

get<T>(String key, {T? def}) → T
getByPath<T>(List path, {dynamic def}) → T
the path is a array of path nodes
getByPathString<T>(String path, {dynamic def}) → T
the path is a String path fot access to a node. for example "posts/news/1/title"
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remove(String key) → void
set(String key, dynamic value) → void
add or set a new node to the model
toMap() Map<String, dynamic>
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited
operator [](String key) Object?
operator []=(String key, dynamic value) → void

Static Methods

toListMap(List<ModelLess> list) List<Map<String, dynamic>>