StateManager class
A class for managing the state and history of image editing changes.
Constructors
- StateManager({required dynamic onStateHistoryChange()?, required EditorImage? activeBackgroundImage})
- Creates an instance of StateManager.
Properties
- activeBackgroundImage ↔ EditorImage?
-
The currently active background image in the editor.
getter/setter pair
- activeBlur → double
-
A getter that returns the current blur value.
This allows you to query the active blur level applied to the image.
no setter
-
activeFilters
↔ List<
FilterState> -
The active filter states applied to the image.
Each FilterState contains filter matrices and optional
video-timeline metadata.
getter/setter pair
-
activeLayers
↔ List<
Layer> -
Get the list of layers from the current image editor changes.
getter/setter pair
-
activeMeta
↔ Map<
String, dynamic> -
The metadata of the current history entry.
getter/setter pair
- activeScreenshot → ThreadCaptureState?
-
Retrieves the currently active screenshot based on the position.
no setter
- activeScreenshotIsBroken → bool?
-
Check if the active screenshot is broken.
no setter
-
activeTuneAdjustments
↔ List<
TuneAdjustmentMatrix> -
The active tune adjustments for the image, such as brightness,
contrast, etc.
Each element in the list is of type
TuneAdjustmentMatrix, representing specific adjustment settings.getter/setter pair - canRedo → bool
-
Determines whether redo actions can be performed on the current state.
no setter
- canUndo → bool
-
Determines whether undo actions can be performed on the current state.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- heroScreenshotRequired ↔ bool
-
Flag indicating if a hero screenshot is required.
getter/setter pair
- historyPointer ↔ int
-
A getter that returns the current position of the history pointer.
The history pointer indicates the current index in the image editor's
state history.
getter/setter pair
- onStateHistoryChange → dynamic Function()?
-
Optional callbacks for additional editor actions.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
screenshots
↔ List<
ThreadCaptureState> -
List of captured screenshots for each state in the history.
getter/setter pair
-
stateHistory
↔ List<
EditorStateHistory> -
A getter that returns the list of historical editor states.
This list provides a record of changes applied to the image, allowing
for undo/redo functionality.
getter/setter pair
- transformConfigs → TransformConfigs
-
A getter that returns the current transformation configuration.
This can be used to retrieve details about active transformations on the
image.
no setter
Methods
-
addHistory(
EditorStateHistory history, {int historyLimit = 1000, bool enableScreenshotLimit = true, bool skipUpdateActiveItems = false}) → void - Adds a new entry to the history of image editor changes and updates the history pointer. This method ensures that any forward changes (redo history) are cleared before adding a new entry.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
redo(
) → void -
Redoes the last undone change, moving the history pointer forward by one
step.
If there is no forward change available, this operation will throw an
error due to out-of-bounds access handled by the
historyPointersetter. -
setHistoryLimit(
int limit, bool enableScreenshotLimit) → void - Set the history limit to manage the maximum number of stored states.
-
toString(
) → String -
A string representation of this object.
inherited
-
undo(
) → void -
Undoes the last change by moving the history pointer back by one step.
This reverts the editor to the previous state.
If there is no previous state available, this operation will throw an
error due to out-of-bounds access handled by the
historyPointersetter. -
updateActiveItems(
) → void - Updates the active items in the editor state based on the current history pointer.
-
updateBackgroundImages(
{required EditorImage oldImage, required EditorImage newImage}) → void - Updates the background images in the editor's history.
-
updateLayerInteraction(
{required bool enableInteraction, required bool onlyCurrentHistory}) → void - Locks or unlocks all layers based on the provided parameters.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited