value property
Gets the value of the JSON list field.
Returns:
- The list of
T
objects.
Implementation
@override
List<T> get value => rawValue ?? [];
Sets the value of the JSON list field.
Parameters:
value
: The new value of the field.
Implementation
@override
set value(dynamic value) {
if (value == null) {
rawValue = [];
return;
}
if (value is List<T>) {
rawValue = value;
return;
}
if (value is List) {
rawValue = value.map((element) {
final model = GetIt.instance.get<T>();
model.fromJSON(element);
return model;
}).toList();
}
}