copyWith method
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,
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,
);
}