toMaps method

List<Map<String, Object?>> toMaps({
  1. bool includeDeleted = false,
  2. bool includeNonPersistent = false,
})

Materializes dataset records as field-name maps.

By default only records in the current visible view and persistent fields are included. includeDeleted reads the raw record store, and includeNonPersistent also emits calculated/non-persistent fields.

Implementation

List<Map<String, Object?>> toMaps({
  bool includeDeleted = false,
  bool includeNonPersistent = false,
}) {
  if (includeDeleted) {
    return [
      for (final record in _recordStore.records)
        _schemaCoordinator.recordMapper.recordToMap(
          record,
          includeNonPersistent: includeNonPersistent,
        ),
    ];
  }
  return [
    for (final index in _view.viewIndexes)
      _schemaCoordinator.recordMapper.recordToMap(
        _recordStore.atRawIndex(index),
        includeNonPersistent: includeNonPersistent,
      ),
  ];
}