ImageEditorController class

ImageEditorController is used to control the state of the image editor by providing functions like rotating, flipping, undoing, and redoing actions. It communicates with the editor state and allows for real-time updates using Flutter's ChangeNotifier.

Inheritance
Mixed-in types

Constructors

ImageEditorController()

Properties

canRedo bool
Returns true if the user can redo a previous undone action, otherwise false.
no setteroverride
canUndo bool
Returns true if the user can undo the most recent action, otherwise false.
no setteroverride
config EditorConfig
get the current config of the editor.
no setteroverride
cropAspectRatio double?
Retrieves the current crop aspect ratio. Returns null if not set, or a value greater than 0 if a ratio is applied.
no setter
currentIndex int
The current editor actions in history which is a copywith editActionDetails.
no setteroverride
editActionDetails EditActionDetails?
Retrieves the details of the current edit action, which may include transformations like cropping, rotating, and scaling.
no setter
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
history List<EditActionDetails>
Do not update it by yourself
no setteroverride
originalCropAspectRatio double?
Retrieves the original aspect ratio of the crop rectangle before any changes. Returns null, or a value equal to or greater than 0.
no setter
rotateDegrees double
Retrieves the current rotation angle of the image. Defaults to 0 if no rotation has been applied.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state ExtendedImageEditorState?
no setter

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
dispose() → void
Discards any resources used by the object.
inherited
flip({bool animation = false, Duration duration = const Duration(milliseconds: 200)}) → void
Flips the image horizontally. You can enable animation and adjust the animation duration.
override
getCropRect() Rect?
Get the rect to crop.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
redo() → void
Redoes the most recent undone action in the editor.
override
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
reset() → void
Resets the image editor to its initial state, undoing all transformations.
override
rotate({double degree = 90, bool animation = false, Duration duration = const Duration(milliseconds: 200), bool rotateCropRect = true}) → void
Rotates the image by a specified angle. Optionally, you can animate the rotation and adjust the rotation of the crop rectangle if the angle is a multiple of 90.
override
saveCurrentState() → void
Save the current state of the editor.
override
toString() String
A string representation of this object.
inherited
undo() → void
Undoes the most recent action in the editor.
override
updateConfig(EditorConfig config) → void
update the current config of the editor
override
updateCropAspectRatio(double? aspectRatio) → void
Updates the crop aspect ratio of the image. A value of null allows freeform cropping.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited