PosterController class
Controller for managing the state of the poster.
- Inheritance
-
- Object
- ChangeNotifier
- PosterController
Constructors
- PosterController({PosterModel? poster})
Properties
- canRedo → bool
-
no setter
- canUndo → bool
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- poster → PosterModel
-
The current poster model.
no setter
-
repaintBoundaryKey
→ GlobalKey<
State< StatefulWidget> > -
GlobalKey for the RepaintBoundary used for exporting.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectedLayer → LayerModel?
-
no setter
Methods
-
addImageFromFile(
String filePath, {Uint8List? bytes}) → void - Adds an image layer from a file path and optional bytes
-
addLayer(
LayerModel layer) → void - Adds a new layer to the poster.
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
bringToFront(
String id) → void - Moves the specified layer to the front of the stack.
-
dispose(
) → void -
Discards any resources used by the object.
inherited
-
duplicateLayer(
String id) → void - Duplicates a layer
-
exportAsImage(
) → Future< Image?> - Exports the current poster state as a high-quality image.
-
exportAsPNG(
{double pixelRatio = 3.0}) → Future< Image?> - Exports poster as PNG with specified quality
-
lockLayer(
String id, bool locked) → void - Locks or unlocks a layer
-
moveLayer(
Offset delta) → void - Moves the currently selected layer by the given delta.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
redo(
) → void - Reapplies the last undone action.
-
removeLayer(
String id) → void - Removes a layer by its ID.
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
reorderLayer(
int oldIndex, int newIndex) → void -
resizeLayer(
String id, Size newSize) → void - Resizes a layer to the specified size
-
rotateLayer(
String id, double angle) → void - Rotates a layer by the specified angle (in radians)
-
scaleLayer(
String id, double scale) → void - Scales a layer
-
selectLayer(
String? id) → void - Selects a layer by its ID. Pass null to deselect all.
-
sendToBack(
String id) → void - Moves the specified layer to the back of the stack.
-
toString(
) → String -
A string representation of this object.
inherited
-
undo(
) → void - Reverts the last action.
-
updateBackground(
Color color) → void - Updates the background color of the poster.
-
updateBackgroundImage(
String path) → void - Updates the background image of the poster.
-
updateLayer(
String id, LayerModel newLayer) → void - Updates an existing layer.
-
updateLayerOpacity(
String id, double opacity) → void - Updates layer opacity
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited