Skip to content

How to detect if a change was made #279

Answered by hm21
Silfalion asked this question in Q&A
Discussion options

You must be logged in to vote

The “screenshot history” handles only the background-generated images. Therefore, in this case, you should access the “history” itself, which includes the class TransformConfigs. Within this class, you can call the isEmpty method to check whether there have been any changes to the transformations or if it remains empty. Below is an example:

var editor = editorKey.currentState!;
var cropEditor = editor.cropRotateEditor.currentState;
if (cropEditor?.history.isNotEmpty == true &&
    cropEditor!.history.first.isNotEmpty) {
  /// Your code
}

If you want to check in the main editor whether any changes have been applied from the crop-rotate editor, you can directly read the transformConfigs as …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by hm21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants