endEdit method Null safety

void endEdit()

Ends the current editing of a cell in SfDataGrid.

Implementation

void endEdit() {
  if (_dataGridStateDetails != null) {
    final DataGridConfiguration dataGridConfiguration =
        _dataGridStateDetails!();
    if (!dataGridConfiguration.allowEditing ||
        dataGridConfiguration.selectionMode == SelectionMode.none ||
        dataGridConfiguration.navigationMode == GridNavigationMode.row) {
      return;
    }

    dataGridConfiguration.currentCell.onCellSubmit(dataGridConfiguration);
  }
}