toList method
Output the value of this record to the List
If toJsonType
is set to true, fields of unsuitable JSON types will be attempted to be converted to String.
Implementation
List<Object?> toList({bool toJsonType=false}){
List<Object?> list = [];
if(_schema != null){
for(FieldSchema field in _schema!.fields){
if(!field.isOutput){
continue;
}
Object? value = _getValue(field, toJsonType);
if(value != null){
if(field.isRecord){
value = (value as Record).toList(toJsonType:toJsonType);
}else if(field.isRecordList){
value = (value as RecordList).toDeepList(toJsonType:toJsonType);
}
}
list.add(value);
}
}
return list;
}