setEditing method

  1. @override
void setEditing(
  1. bool flag, {
  2. bool notify = true,
})
inherited

Change the editing status of the current cell.

Implementation

@override
void setEditing(
  bool flag, {
  bool notify = true,
}) {
  if (!mode.isEditableMode || (flag && currentCell == null)) {
    flag = false;
  }

  if (isEditing == flag) return;

  if (flag) {
    assert(
      currentCell?.column != null && currentCell?.row != null,
      """
    PlutoCell is not Initialized.
    PlutoColumn and PlutoRow must be initialized in PlutoCell via PlutoGridStateManager.
    initializeRows method. When adding or deleting columns or rows,
    you must use methods on PlutoGridStateManager. Otherwise,
    the PlutoCell is not initialized and this error occurs.
    """,
    );

    if (!isEditableCell(currentCell!)) {
      flag = false;
    }
  }

  _state._isEditing = flag;

  clearCurrentSelecting(notify: false);

  notifyListeners(notify, setEditing.hashCode);
}