Skip to content
Discussion options

You must be logged in to vote

It's not possible to directly extend EditorStateHistory unless you fork the entire project.

But you can handle it directly in your code. Simply add an empty history editorKey.currentState!.addHistory(). However, you'll also need to specify in your code at which history index the background changed. To get the active history index, use editorKey.currentState!.stateManager.historyPointer. The final step is to listen for undo/redo actions and apply the correct background image based on your state.

 callbacks: ProImageEditorCallbacks(
  mainEditorCallbacks: MainEditorCallbacks(
    onUndo: () {
      editorKey.currentState!.updateBackgroundImage(image);
    },
    onRedo: () {
      editorKey…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by yangheecho
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