updateState method

  1. @override
void updateState(
  1. PlutoNotifierEvent event
)

Called when a state change of PlutoGridStateManager occurs.

Widgets in PlutoGrid that inherit this widget implement this method to decide whether to rebuild the widget according to the state change.

By calling oldValue and newValue with the update method, rebuild the widget according to the value change.

void updateState(PlutoNotifierEvent event) {
  _showColumnFilter = update<bool>(
    _showColumnFilter,
    stateManager.showColumnFilter,
  );
}

Implementation

@override
void updateState(PlutoNotifierEvent event) {
  _showColumnTitle = update<bool>(
    _showColumnTitle,
    stateManager.showColumnTitle,
  );

  _showColumnFilter = update<bool>(
    _showColumnFilter,
    stateManager.showColumnFilter,
  );

  _showColumnFooter = update<bool>(
    _showColumnFooter,
    stateManager.showColumnFooter,
  );

  _showColumnGroups = update<bool>(
    _showColumnGroups,
    stateManager.showColumnGroups,
  );

  _showFrozenColumn = update<bool>(
    _showFrozenColumn,
    stateManager.showFrozenColumn,
  );

  _showLoading = update<bool>(
    _showLoading,
    stateManager.showLoading,
  );

  _hasLeftFrozenColumns = update<bool>(
    _hasLeftFrozenColumns,
    stateManager.hasLeftFrozenColumns,
  );

  _hasRightFrozenColumns = update<bool>(
    _hasRightFrozenColumns,
    stateManager.hasRightFrozenColumns,
  );

  _bodyLeftOffset = update<double>(
    _bodyLeftOffset,
    stateManager.bodyLeftOffset,
  );

  _bodyRightOffset = update<double>(
    _bodyRightOffset,
    stateManager.bodyRightOffset,
  );

  _rightFrozenLeftOffset = update<double>(
    _rightFrozenLeftOffset,
    stateManager.rightFrozenLeftOffset,
  );
}