copyWith method

TableConfig copyWith({
  1. String? visualType,
  2. String? visualName,
  3. String? title,
  4. String? query,
  5. List<ColumnConfig>? rowIndex,
  6. List<ColumnConfig>? valuesConfig,
  7. List<ColumnConfig>? columns,
  8. int? fixedColumns,
  9. bool? totals,
  10. bool? topN,
  11. Object? sortColumn = _keep,
  12. Object? sortOrder = _keep,
  13. bool? dataTreeStartExpanded,
  14. bool? treeEnabled,
  15. bool? headerFilter,
  16. bool? selectableRows,
  17. bool? showSelectionChips,
  18. Object? rowHeight = _keep,
  19. bool? enableLineHeightAdjustment,
})

Create a copy with selected fields overridden. Use _clear sentinel for nullable fields you want to explicitly set to null. Example: copyWith(onScroll: _clear.onScroll) — not needed normally, just pass the new value directly. For nullable fields like rowHeight, sortColumn, sortOrder, onScroll — passing a non-null value sets it, omitting it keeps the existing value.

Implementation

TableConfig copyWith({
  String? visualType,
  String? visualName,
  String? title,
  String? query,
  List<ColumnConfig>? rowIndex,
  List<ColumnConfig>? valuesConfig,
  List<ColumnConfig>? columns,
  int? fixedColumns,
  bool? totals,
  bool? topN,
  Object? sortColumn = _keep,
  Object? sortOrder = _keep,
  bool? dataTreeStartExpanded,
  bool? treeEnabled,
  bool? headerFilter,
  bool? selectableRows,
  bool? showSelectionChips,
  Object? rowHeight = _keep,
  bool? enableLineHeightAdjustment,
}) {
  return TableConfig(
    visualType: visualType ?? this.visualType,
    visualName: visualName ?? this.visualName,
    title: title ?? this.title,
    query: query ?? this.query,
    rowIndex: rowIndex ?? this.rowIndex,
    valuesConfig: valuesConfig ?? this.valuesConfig,
    columns: columns ?? this.columns,
    fixedColumns: fixedColumns ?? this.fixedColumns,
    totals: totals ?? this.totals,
    topN: topN ?? this.topN,
    sortColumn: sortColumn == _keep ? this.sortColumn : sortColumn as String?,
    sortOrder: sortOrder == _keep ? this.sortOrder : sortOrder as String?,
    dataTreeStartExpanded: dataTreeStartExpanded ?? this.dataTreeStartExpanded,
    treeEnabled: treeEnabled ?? this.treeEnabled,
    headerFilter: headerFilter ?? this.headerFilter,
    selectableRows: selectableRows ?? this.selectableRows,
    showSelectionChips: showSelectionChips ?? this.showSelectionChips,
    rowHeight: rowHeight == _keep ? this.rowHeight : rowHeight as double?,
    enableLineHeightAdjustment: enableLineHeightAdjustment ?? this.enableLineHeightAdjustment,
  );
}