PaintController class

The PaintController class is responsible for managing and controlling the paint state.

Inheritance

Constructors

PaintController({required double strokeWidth, required Color color, required PaintMode mode, required bool fill, required int strokeMultiplier, required double opacity})
Creates an instance of the PaintController with initial settings.

Properties

busy → bool
Indicates whether there is an ongoing paint action.
no setter
color → Color
Returns the current color used for paint.
no setter
end → Offset?
Returns the ending point of a paint action.
no setter
fill → bool
Indicates whether the current mode requires filling (e.g., circle or rectangle).
no setter
hashCode → int
The hash code for this object.
no setterinherited
hasListeners → bool
Whether any listeners are currently registered.
no setterinherited
mode → PaintMode
Returns the current paint mode (e.g., line, circle, rectangle).
no setter
offsets → List<Offset?>
Returns the list of recorded paint offsets.
no setter
opacity ↔ double
The opacity for the drawing
getter/setter pair
paintedModel → PaintedModel
Getter for the current state of the painted model.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scaledStrokeWidth → double
Returns the scaled stroke width based on the stroke multiplier.
no setter
start → Offset?
Returns the starting point of a paint action.
no setter
strokeWidth → double
Returns the current stroke width.
no setter

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
addOffsets(Offset offset) → void
Adds an offset to the list of offsets and notifies listeners.
dispose() → void
Discards any resources used by the object.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
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 starting and ending points and clears the offsets list, then notifies listeners.
setColor(Color color) → void
Sets the paint color to the specified color and notifies listeners.
setEnd(Offset offset) → void
Sets the ending point of a paint action and notifies listeners.
setFill(bool fill) → void
Sets whether the current mode should fill the shape and notifies listeners.
setInProgress(bool val) → void
Sets the paint progress state and notifies listeners.
setMode(PaintMode mode) → void
Sets the paint mode to the specified mode and notifies listeners.
setOpacity(double value) → void
Sets the current level of opacity.
setStart(Offset offset) → void
Sets the starting point of a paint action and notifies listeners.
setStrokeMultiplier(int value) → void
Sets the stroke multiplier to the specified value and notifies listeners.
setStrokeWidth(double val) → void
Sets the stroke width to the specified value and notifies listeners.
toString() → String
A string representation of this object.
inherited

Operators

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