适用于 Flutter 的腾讯云验证码插件
将此添加到包的 pubspec.yaml 文件中:
dependencies:
flutter_tencent_captcha: ^0.1.2
您可以从命令行安装软件包:
$ flutter packages get
String sdkVersion = await TencentCaptcha.sdkVersion;
TencentCaptcha.init('<appId>');
详细参数请参见:https://cloud.tencent.com/document/product/1110/36841
TencentCaptchaConfig config = TencentCaptchaConfig(
bizState: 'tencent-captcha',
enableDarkMode: true,
);
await TencentCaptcha.verify(
config: config,
onLoaded: (dynamic data) {
_addLog('onLoaded', data);
},
onSuccess: (dynamic data) {
_addLog('onSuccess', data);
},
onFail: (dynamic data) {
_addLog('onFail', data);
},
);