toMap method

List<Map<String, Object?>> toMap({
  1. bool hasNull = true,
  2. bool toJsonType = false,
})

Output the value of this record to the List

If hasNull is set to false, fields with a value of null will not be output. this can be used to reduce the output when there is no need to tell that they are null. If toJsonType is set to true, fields of unsuitable JSON types will be attempted to be converted to String.

Implementation

List<Map<String,Object?>> toMap({bool hasNull=true,bool toJsonType=false}){
  List<Map<String,Object?>> list = [];
  Iterator<Record> itr = iterator;
  while(itr.moveNext()){
    list.add(itr.current.toMap(hasNull:hasNull, toJsonType:toJsonType));
  }
  return list;
}