CartesianCanvasController class
A controller for interacting programmatically with a CartesianPlane.
This controller can be passed to a CartesianPlane to allow external widgets to trigger view resets, zoom, freehand drawing modes, and more.
- Inheritance
-
- Object
- ChangeNotifier
- CartesianCanvasController
Constructors
Properties
- canvasDelegate ↔ CartesianCanvasDelegate?
-
The attached delegate, usually provided by the CartesianPlane's state.
getter/setter pair
- drawingMode ↔ bool
-
Whether the drawing mode is active.
getter/setter pair
- eraserMode ↔ bool
-
Whether the eraser mode is active.
getter/setter pair
- gridVisible ↔ bool
-
Whether the grid is currently visible.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
attach(
CartesianCanvasDelegate newDelegate) → void -
Attaches a
newDelegateto this controller. Called automatically by CartesianPlane. -
captureImage(
) → Future< Image?> - Captures and returns an image of the current canvas viewport.
-
clearFreehand(
) → void - Deletes all freehand strokes drawn on the canvas.
-
detach(
) → void - Detaches the current delegate from this controller.
-
dispose(
) → void -
Discards any resources used by the object.
inherited
-
fitToContent(
) → void - Adjusts the scale and origin to fit all elements currently on the plane.
-
goToPoint(
double x, double y) → void -
Moves the center of the camera to the specified world coordinates
xandy. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
redoFreehand(
) → void - Redoes the last undone freehand drawing or erase action.
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
resetView(
) → void - Resets the CartesianPlane view to the initial scale and origin.
-
setDrawingMode(
bool isEnabled) → void - Helper method to toggle or set drawing mode.
-
setEraserMode(
bool isEnabled) → void - Helper method to toggle or set eraser mode.
-
setGridVisible(
bool isVisible) → void - Helper method to toggle or set grid visibility.
-
toString(
) → String -
A string representation of this object.
inherited
-
undoFreehand(
) → void - Undoes the last freehand drawing or erase action.
-
zoomIn(
) → void - Zooms the canvas in by a fixed multiplier.
-
zoomOut(
) → void - Zooms the canvas out by a fixed multiplier.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited