-
Hello, I'm trying to modify the crop and rotate editor to check if there were any changes before starting the edit as to not generate another image(and speeding up the last step for the user). Right now I'm using the screenshot history variable, however this seems to be unreliable because the initial array has 1 element and the first editing replaces this element. Any ideas as to how to track it more reliably? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The “screenshot history” handles only the background-generated images. Therefore, in this case, you should access the “history” itself, which includes the class 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 if (editorKey.currentState!.stateHistory.last.transformConfigs.isNotEmpty) {
/// Your code
} |
Beta Was this translation helpful? Give feedback.
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 theisEmpty
method to check whether there have been any changes to the transformations or if it remains empty. Below is an example: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 …