JsonArrayCast class
Cast attribute to/from JSON Array (List<Map<String, dynamic>>)
Example:
Map<String, Type> get casts => {
'addresses': JsonArrayCast,
'items': JsonArrayCast,
};
// Usage:
user.addresses = [
{'street': '123 Main', 'city': 'NYC'},
{'street': '456 Oak', 'city': 'LA'},
];
print(user.addresses[0]['city']); // 'NYC'
- Inheritance
-
- Object
- AttributeCaster<
List< Map< >String, dynamic> > - JsonArrayCast
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
get(
dynamic value) → List< Map< ?String, dynamic> > -
Convert database value to model property value
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
set(
List< Map< ? value) → dynamicString, dynamic> > -
Convert model property value to database value
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited