HandSignatureControl class

A ChangeNotifier that controls the drawing and manipulation of a hand signature. It manages the active paths, their setup, and provides methods for starting, altering, closing, importing, and exporting signature data.

Inheritance

Constructors

HandSignatureControl.new({@Deprecated('Use {setup} or {initialSetup}') double threshold = 3.0, @Deprecated('Use {setup} or {initialSetup}') double smoothRatio = 0.65, @Deprecated('Use {setup} or {initialSetup}') double velocityRange = 2.0, @Deprecated('Use {setup} or {initialSetup}') double pressureRatio = 0.0, SignaturePathSetup setup()?, SignaturePathSetup? initialSetup})
Controls input from HandSignature and creates smooth signature path.
HandSignatureControl.fromMap(Map<String, dynamic> data)
factory

Properties

hasActivePath bool
Indicates whether there is an active (unfinished) path being drawn.
no setter
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
isFilled bool
Indicates whether any signature data has been drawn (i.e., if there are any completed paths).
no setter
lines List<CubicLine>
Returns a flattened list of all CubicLine segments across all paths.
no setter
params SignaturePaintParams?
Optional visual parameters for line painting, primarily for backwards compatibility.
getter/setter pair
paths List<CubicPath>
Returns an unmodifiable list of all completed CubicPaths.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
setup SignaturePathSetup Function()
A function that provides the SignaturePathSetup for new paths.
getter/setter pair

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
addPath(List<CubicPath> paths, [Size? bounds]) → void
Imports given paths and alters current signature data.
alterPath(Offset point, {double? pressure}) → void
Adds [point[ to active path.
clear() → void
Clears all data.
closePath({Offset? point, double? pressure}) → 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.
import(Map data) → void
Expects data from toMap.
importData(Map data) → void
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
setSetup(SignaturePathSetup setup) → void
Sets setup for next Path
startPath(Offset point, {double? pressure}) → void
Starts new line at given point.
stepBack() CubicPath?
Removes last Path. returns removed CubicPath.
toImage({int width = 512, int height = 256, Color? color, Color? background, double? strokeWidth, double? maxStrokeWidth, HandSignatureDrawer? drawer, double border = 0.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 import method.
toPicture({int width = 512, int height = 256, Color? color, Color? background, double? strokeWidth, double? maxStrokeWidth, HandSignatureDrawer? drawer, double border = 0.0, bool fit = false}) 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