closeEditor method

void closeEditor()

Close the image editor.

This function allows the user to close the image editor without saving any changes or edits. It navigates back to the previous screen or closes the modal editor.

Implementation

void closeEditor() {
  if (stateManager.position <= 0) {
    if (onCloseEditor == null) {
      Navigator.pop(context);
    } else {
      onCloseEditor!.call();
    }
  } else {
    closeWarning();
  }
}