HandSignatureControl class

Controls signature drawing and line shape. Also handles export of finished signature.

Inheritance

Constructors

HandSignatureControl({double threshold = 3.0, double smoothRatio = 0.65, double velocityRange = 2.0})
Controls input from HandSignature and creates smooth signature path. threshold minimal distance between two points. smoothRatio smoothing ratio of curved parts. velocityRange controls velocity speed and dampening between points (only Shape and Arc drawing types using this property to control line width). aka how fast si signature drawn..
HandSignatureControl.fromMap(Map<String, dynamic> data)
factory

Properties

hasActivePath bool
Checks if is there unfinished path.
no setter
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
isFilled bool
Checks if something is drawn.
no setter
lines List<CubicLine>
Lazy list of all Lines.
no setter
params SignaturePaintParams?
Visual parameters of line painting.
getter/setter pair
paths List<CubicPath>
List of currently completed lines.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
smoothRatio double
Smoothing ratio of path.
final
threshold double
Distance between two control points.
final
velocityRange double
Maximal velocity.
final

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
alterPath(Offset point) → void
Adds [point[ to active path.
clear() → void
Clears all data.
closePath([Offset? point]) → void
Closes active path at given point.
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed).
override
equals(HandSignatureControl other) bool
Currently checks only equality of paths.
importData(Map data) → void
Expects data from toMap.
importPath(List<CubicPath> paths, [Size? bounds]) → void
Imports given paths and alters current signature data.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyDimension(Size size) bool
Handles canvas size changes.
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
startPath(Offset point) → void
Starts new line at given point.
stepBack() bool
Removes last line.
toImage({int width = 512, int height = 256, Color? color, Color? background, double? strokeWidth, double? maxStrokeWidth, double border = 32.0, ImageByteFormat format = ImageByteFormat.png, bool fit = false}) Future<ByteData?>
Exports data to raw image.
toMap() Map<String, dynamic>
Converts dat to Map (json) Exported data can be restored via HandSignatureControl.fromMap factory or via importData method.
toPicture({int width = 512, int height = 256, Color? color, Color? background, double? strokeWidth, double? maxStrokeWidth, double border = 0.0, bool fit = true}) Picture?
Exports data to Picture.
toString() String
A string representation of this object.
inherited
toSvg({SignatureDrawType type = SignatureDrawType.shape, int width = 512, int height = 256, double border = 0.0, Color? color, double? strokeWidth, double? maxStrokeWidth, bool fit = false}) String?
Converts data to svg String. type - data structure.

Operators

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