서명 패키지는 디지털 서명을 캡처하기 위한 고성능 캔버스를 제공하는 플러터 플러그인입니다. 사용자 정의 스타일, 경계 제약 조건 및 초기 상태 구성이 지원되어 양식과 인증 워크플로에 적합합니다. 크로스플랫폼 사용을 위해 설계되었으며 안드로이드, iOS, 웹, 맥OS, 윈도우, 리눅스에서 원활하게 작동합니다. 최소한의 지연으로 부드러운 그림 그리기를 보장하며, 구성 가능한 옵션을 통해 외관과 동작에 유연성을 제공합니다.
사용 사례
디지털 서명 수집
서명 검증이 있는 폼 제출
인증 워크플로
전자 서명 통합
사용자 신원 확인
주요 기능
사용자 정의 가능한 테두리 스타일 및 색상
서명 영역의 경계 제한
초기 상태 지원 (예: 사전 입력된 서명)
고성능 렌더링
크로스 플랫폼 호환성
사용자 정의 가능한 캔버스 크기 및 패딩
적합한 대상
전자 서명 기능이 필요한 앱 개발자
사용자 인증이 필요한 양식
그림 그리기 필요성이 있는 모바일 및 웹 애플리케이션
규제 요구사항을 갖춘 기업용 앱
다중 플랫폼 대상 애플리케이션
고려 사항
캔버스 크기 및 스케일링을 올바르게 처리해야 합니다
서명의 진위성을 확인하기 위해 추가 검증이 필요할 수 있습니다
성능은 장치의 기능에 따라 달라집니다
기본적인 그림 그리기에 국한됨; 복잡한 그림 그리기는 불가능
이미지 데이터 외에 내장된 내보내기 형식 없음
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
signature
A Flutter plugin providing performance optimized signature canvas with ability
to set custom style, boundaries and initial state. This is native flutter
implementation, so it supports all platforms.
Why
In time of creation of this plugin, there was no available solution that had:
required performance on wide range of devices
ability to set canvas boundaries
ability to initialize using previously saved state
Migration to 5.0.0+
This version no longer wraps Signature in Expanded widget if you are using
it without specifying dimensions
This removes error Incorrect use of ParentDataWidget, see
this issue for more
information.
If you are passing dimensions to widget, you do not have to change anything.
If you are using widget without dimensions inside Row, Column or Flex
widgets, you have to wrap Signature inside Expanded yourself.
If you are using widget without dimensions, but not inside mentioned widgets
you do not have change anything and error should dissapear from your logs :)
Take a look at our example project as well: Signature Demo
// IMPORT PACKAGEimport'package:signature/signature.dart';
// Initialise a controller. It will contains signature points, stroke width and pen color.// It will allow you to interact with the widgetfinalSignatureController _controller = SignatureController(
penStrokeWidth: 5,
penColor: Colors.red,
exportBackgroundColor: Colors.blue,
);
// INITIALIZE. RESULT IS A WIDGET, SO IT CAN BE DIRECTLY USED IN BUILD METHOD var _signatureCanvas = Signature(
controller: _controller,
width: 300,
height: 300,
backgroundColor: Colors.lightBlueAccent,
);
// CLEAR CANVAS
_controller.clear();
// EXPORT BYTES AS PNG// The exported image will be limited to the drawn area
_controller.toPngBytes();
// isEmpty/isNotEmpty CAN BE USED TO CHECK IF SIGNATURE HAS BEEN PROVIDED
_controller.isNotEmpty; //true if signature has been provided
_controller.isEmpty; //true if signature has NOT been provided// EXPORT POINTS (2D POINTS ROUGHLY REPRESENTING WHAT IS VISIBLE ON CANVAS)var exportedPoints = _controller.points;
//EXPORTED POINTS CAN BE USED TO INITIALIZE PREVIOUS CONTROLLERfinalSignatureController _controller = SignatureController(points: exportedPoints);
//DONT FORGET TO DISPOSE IT IN THE `dispose()` METHOD OF STATEFUL WIDGETS@overridevoiddispose() {
_controller.dispose();
super.dispose();
}