SignatureController class

class for interaction with signature widget manages points representing signature on canvas provides signature manipulation functions (export, clear)

Inheritance

Constructors

SignatureController({List<Point>? points, Color penColor = Colors.black, double penStrokeWidth = 3.0, Color? exportBackgroundColor, VoidCallback? onDrawStart, VoidCallback? onDrawMove, VoidCallback? onDrawEnd, double mosaicWidth = 5.0})
constructor

Properties

drawStyle ↔ DrawStyle
draw style
getter/setter pair
exportBackgroundColor → Color?
background color to be used in exported png image
final
hashCode → int
The hash code for this object.
no setterinherited
hasListeners → bool
Whether any listeners are currently registered.
no setterinherited
isEmpty → bool
check if canvas is empty (opposite of isNotEmpty method for convenience)
no setter
isNotEmpty → bool
check if canvas is not empty (opposite of isEmpty method for convenience)
no setter
mosaicWidth → double
mosaic pixel's width
final
onDrawEnd ↔ VoidCallback?
callback to notify when drawing has stopped
getter/setter pair
onDrawMove ↔ VoidCallback?
callback to notify when the pointer was moved while drawing.
getter/setter pair
onDrawStart ↔ VoidCallback?
callback to notify when drawing has started
getter/setter pair
penColor → Color
color of a signature line
final
penStrokeWidth → double
boldness of a signature line
final
points ↔ List<Point>
getter for points representing signature on 2D canvas
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
value ↔ List<Point>
The current value stored in this notifier.
getter/setter pairinherited

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
addPoint(Point point) → void
add point to point collection
clear() → void
clear the canvas
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
pushCurrentStateToUndoStack() → void
REMEMBERS CURRENT CANVAS STATE IN UNDO STACK
redo() → void
It will remove last reverted actions and add it into _latestActions Then, it will modify the real points with the last reverted action.
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
toImage() → Future<Image?>
convert to
toPngBytes() → Future<Uint8List?>
convert canvas to dart:ui Image and then to PNG represented in Uint8List
toString() → String
A string representation of this object.
inherited
undo() → void
It will remove last action from _latestActions. The last action will be saved to _revertedActions that will be used to do redo-ing. Then, it will modify the real points with the last action.

Operators

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