v1.0.7easy_signature_pad
提供用户签名的区域,并返回签名和Base64图像。
34喜欢 2350近 30 天下载150Pub 分数
AndroidiOSWebmacOSWindowsLinux
Flutter Signature Pad 是一个 Flutter 插件,允许用户在画布上绘制并以 Base64 图像形式获取签名。
以下为英文项目原文快照,最新内容请访问 GitHub。
Easy Signature Pad is the flutter plugin that allows users to draw on the canvas and get the signature as Base64 image.
import 'package:easy_signature_pad/easy_signature_pad.dart';
// initialise the variable to store signature image
Uint8List signatureBytes;
// Use the SignaturePad Widget
EasySignaturePad(
onChanged: (image) {
setImage(image);
},
height: size.width ~/ 2,
width: size.width ~/ 1.5,
penColor: Colors.black,
strokeWidth: 1.0,
borderRadius: 10.0,
borderColor: Colors.white,
backgroundColor: Colors.white,
transparentImage: false,
transparentSignaturePad: false,
hideClearSignatureIcon: false,
),
// process the base64 image
void setImage(String bytes) async {
if (bytes.isNotEmpty) {
Uint8List convertedBytes = base64Decode(bytes);
setState(() {
signatureBytes = convertedBytes;
});
} else {
setState(() {
signatureBytes = null;
});
}
}
依赖清单 2 项
{"sdk":"flutter"}{"sdk":"flutter"}先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗