SignaturePreview constructor

SignaturePreview({
  1. Key? key,
  2. void onSignCapture(
    1. Future<Uint8List> signImageBytes
    )?,
  3. bool autoClearOnDone = false,
  4. bool autoClearOnCancel = true,
  5. Color screenColor = Colors.white,
  6. Color signColor = primaryColor,
  7. double signStrokeWidth = 2,
  8. double signCapturePixelRatio = 1.0,
  9. bool enableTouchSign = false,
  10. bool enablePenSign = true,
  11. bool enableSignGuide = false,
  12. bool enableActionButtons = true,
  13. double aspectRatio = DEVICE_ASPECT_RATIO,
})

A Widget that captures Signature with Scriptel Signature Pad device or touch

Implementation

SignaturePreview({
  Key? key,
  this.onSignCapture,
  this.autoClearOnDone = false,
  this.autoClearOnCancel = true,
  this.screenColor = Colors.white,
  this.signColor = primaryColor,
  this.signStrokeWidth = 2,
  this.signCapturePixelRatio = 1.0,
  this.enableTouchSign = false,
  this.enablePenSign = true,
  this.enableSignGuide = false,
  this.enableActionButtons = true,
  this.aspectRatio = DEVICE_ASPECT_RATIO,
}) : super(key: key) {
  _focusNode.addListener(() => _isFocused.value = _focusNode.hasFocus);
  if (enablePenSign) {
    _plugin.setListener(
      onSignCoordinate: _registerSignCoordinate,
      onSignCancel: _registerSignCancel,
      onSignEnd: _registerSignComplete,
      onSignStart: _registerNewSignStart,
      onNewStroke: _registerNewStroke,
      onSignMeta: (model, version, protocolVersion) {},
    );
  }
}