Skip to content

Commit 2f054c3

Browse files
committed
update to flutter 2.0
0 parents  commit 2f054c3

File tree

101 files changed

+2832
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+2832
-0
lines changed

.github/workflows/publish.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Publish to Pub.dev
2+
3+
on: create
4+
5+
jobs:
6+
publishing:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: 'Checkout'
10+
uses: actions/checkout@v2
11+
12+
- name: '>> Dart package <<'
13+
uses: k-paxian/dart-package-publisher@master
14+
with:
15+
flutter: true
16+
skipTests: true
17+
accessToken: ${{ secrets.OAUTH_ACCESS_TOKEN }}
18+
refreshToken: ${{ secrets.OAUTH_REFRESH_TOKEN }}

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.DS_Store
2+
.dart_tool/
3+
4+
.packages
5+
.pub/
6+
pubspec.lock
7+
8+
build/
9+
/.idea
10+
11+
.history

.metadata

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This file tracks properties of this Flutter project.
2+
# Used by Flutter tool to assess capabilities and perform upgrades etc.
3+
#
4+
# This file should be version controlled and should not be manually edited.
5+
6+
version:
7+
revision: 1aafb3a8b9b0c36241c5f5b34ee914770f015818
8+
channel: stable
9+
10+
project_type: plugin

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## 2.0.0
2+
3+
* 支持空安全
4+
5+
## 1.0.2
6+
7+
* 修复韩语、日语、法语下无法弹起验证框的问题。
8+
9+
## 1.0.1
10+
11+
* 修复Android端eventSink没有在主线程出发的问题。
12+
13+
## 1.0.0
14+
15+
* 初始化

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) [2020] [flutter-fast-kit]
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
# flutter_net_captcha
2+
3+
[![Pub](https://img.shields.io/pub/v/flutter_net_captcha.svg)](https://pub.dartlang.org/packages/flutter_net_captcha)
4+
[![Awesome Flutter](https://img.shields.io/badge/Awesome-Flutter-blue.svg?longCache=true&style=flat-square)]()
5+
[![Awesome Flutter](https://img.shields.io/badge/Platform-Android_iOS-blue.svg?longCache=true&style=flat-square)]()
6+
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](/LICENSE)
7+
8+
网易易盾-行为验证码,Flutter 插件!
9+
10+
## 使用
11+
12+
🔩 安装
13+
14+
`pubspec.yaml` 添加依赖
15+
16+
```
17+
dependencies:
18+
flutter_net_captcha: <last_version>
19+
```
20+
21+
⚙️ 配置
22+
23+
#### iOS
24+
25+
无需配置
26+
27+
28+
#### Android
29+
30+
无需配置
31+
32+
如需要进行混淆, proguard混淆配置文件增加:
33+
34+
```
35+
-keepattributes *Annotation*
36+
-keep public class com.netease.nis.captcha.**{*;}
37+
38+
-keep public class android.webkit.**
39+
40+
-keepattributes SetJavaScriptEnabled
41+
-keepattributes JavascriptInterface
42+
43+
-keepclassmembers class * {
44+
@android.webkit.JavascriptInterface <methods>;
45+
}
46+
```
47+
48+
49+
🔨 使用
50+
51+
```dart
52+
import 'package:flutter_net_captcha/flutter_net_captcha.dart';
53+
```
54+
55+
#### 1. 配置验证码
56+
57+
```dart
58+
FlutterNetCaptcha.configVerifyCode(VerifyCodeConfig);
59+
```
60+
61+
VerifyCodeConfig
62+
63+
| 参数 | 描述 | 类型 | 默认值 |
64+
| -------- | ----------------- | ----- | ------ |
65+
| captchaId | 验证码id,管理后台获取 | String | Null |
66+
| timeoutInterval | 加载验证码的超时时间 | int | 10 |
67+
| mode | 验证码类型 | VerifyCodeMode | Normal |
68+
| openFallBack | 是否开启降级方案 | bool | true |
69+
| fallBackCount | 设置发生第fallBackCount次错误时,将触发降级 | int | 3 |
70+
| ipv6 | 是否支持ipv6 | bool | false |
71+
| closeButtonHidden | 是否隐藏关闭按钮 | bool | false |
72+
| shouldCloseByTouchBackground | 点击背景是否可以关闭验证码视图 | bool | true |
73+
| enableLog | 是否开启sdk日志打印 | bool | true |
74+
75+
VerifyCodeMode(验证码类型)
76+
77+
- Normal 通用
78+
- NoSense 无感知
79+
80+
#### 2. 验证
81+
82+
```
83+
FlutterNetCaptcha.showCaptcha(
84+
mode: VerifyCodeMode.Normal,
85+
language: VerifyLanguage.ZH_TW,
86+
onLoaded: () {
87+
print('onLoaded...');
88+
},
89+
onVerify: (VerifyCodeResponse response) {
90+
print(response);
91+
},
92+
onError: (String message) {
93+
print(message);
94+
},
95+
onClose: (VerifyCodeClose close) {
96+
print('close: $close');
97+
});
98+
```
99+
100+
VerifyCodeClose (验证码窗口关闭类型)
101+
102+
- Manual 手动
103+
- Auto 验证成功后自动关闭
104+
105+
支持的语言
106+
107+
```dart
108+
enum VerifyLanguage {
109+
/// 中文
110+
ZH_CN,
111+
112+
/// 英文
113+
EN,
114+
115+
/// 繁体
116+
ZH_TW,
117+
118+
/// 日文
119+
JP,
120+
121+
/// 韩文
122+
KR,
123+
124+
/// 泰文
125+
TL,
126+
127+
/// 越南语
128+
VT,
129+
130+
/// 法语
131+
FRA,
132+
133+
/// 俄语
134+
RUS,
135+
136+
/// 阿拉伯语
137+
KSA,
138+
139+
/// 德语
140+
DE,
141+
142+
/// 意大利语
143+
IT,
144+
145+
/// 希伯来语
146+
HE,
147+
148+
/// 印地语
149+
HI,
150+
151+
/// 印尼语
152+
ID,
153+
154+
/// 缅甸语
155+
MY,
156+
157+
/// 老挝语
158+
LO,
159+
160+
/// 马来语
161+
MS,
162+
163+
/// 波兰语
164+
PL,
165+
166+
/// 葡萄牙语
167+
PT,
168+
169+
/// 西班牙语
170+
ES,
171+
172+
/// 土耳其语
173+
TR,
174+
}
175+
```
176+
177+
#### 3. 获取sdk版本号
178+
179+
```dart
180+
String v = await FlutterNetCaptcha.getSdkVersion();
181+
```
182+
183+
## Changelog
184+
185+
Refer to the [Changelog](CHANGELOG.md) to get all release notes.

android/.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/workspace.xml
5+
/.idea/libraries
6+
.DS_Store
7+
/build
8+
/captures

android/.idea/.gitignore

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

android/.idea/.name

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
489 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)