collapseGroupsAtLevel method

void collapseGroupsAtLevel(
  1. int level
)

Collapses the groups based on the respective level.

Implementation

void collapseGroupsAtLevel(int level) {
  if (_dataGridStateDetails != null) {
    final DataGridConfiguration dataGridConfiguration =
        _dataGridStateDetails!();
    final Group grouping = dataGridConfiguration.group!;
    final int length = dataGridConfiguration.source.groupedColumns.length;

    if (level > 0 && level <= length) {
      grouping.collapseGroupAtLevel(level, grouping);
      notifyDataGridPropertyChangeListeners(dataGridConfiguration.source,
          propertyName: 'grouping');
    }
  }
}