saveColumnState static method

void saveColumnState(
  1. Map<int, ColumnState> columnState, {
  2. String? tableId,
})

Saves column state to the in-memory cache.

Column state (width, visibility, and pin status) is persisted throughout the session and restored when the table is rebuilt (e.g., on browser resize).

Implementation

static void saveColumnState(
  Map<int, ColumnState> columnState, {
  String? tableId,
}) {
  try {
    final key = _getStorageKey(tableId);
    _memoryCache[key] = Map<int, ColumnState>.from(columnState);
  } catch (e) {
    debugPrint('Error saving column state: $e');
  }
}