Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx_verification_code
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
openSourceLibrary
clx_verification_code
Commits
51ab5a3d
提交
51ab5a3d
authored
4月 28, 2025
作者:
祁增奎
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加防抖功能
上级
06453845
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
115 行增加
和
6 行删除
+115
-6
clx_verification_code.dart
lib/clx_verification_code.dart
+1
-0
clx_line_code_manage_view.dart
lib/views/clx_line_code_manage_view.dart
+1
-1
clx_interval_button.dart
lib/widgets/button/clx_interval_button.dart
+105
-0
no_receive_resend_sms_view.dart
lib/widgets/tips_widget/no_receive_resend_sms_view.dart
+2
-1
no_receive_sms_view.dart
lib/widgets/tips_widget/no_receive_sms_view.dart
+3
-2
no_receive_voice_view.dart
lib/widgets/tips_widget/no_receive_voice_view.dart
+3
-2
没有找到文件。
lib/clx_verification_code.dart
浏览文件 @
51ab5a3d
...
...
@@ -17,6 +17,7 @@ export 'widgets/input_widget/code_input_view.dart';
export
'widgets/tips_widget/no_receive_resend_sms_view.dart'
;
export
'widgets/tips_widget/no_receive_sms_view.dart'
;
export
'widgets/tips_widget/no_receive_voice_view.dart'
;
export
'widgets/button/clx_interval_button.dart'
;
/// -------公共Utils---------
export
'utils/line_code_manage_config.dart'
;
...
...
lib/views/clx_line_code_manage_view.dart
浏览文件 @
51ab5a3d
...
...
@@ -52,7 +52,7 @@ class CLXLineCodeManageView extends StatelessWidget {
Obx
(
()
=>
Visibility
(
visible:
loigc
.
codeSendBtn
.
value
.
isNotEmpty
,
child:
GestureDetector
(
child:
CLXIntervalBtn
(
onTap:
loigc
.
sendSmsCode
,
child:
Text
(
loigc
.
codeSendBtn
.
value
,
...
...
lib/widgets/button/clx_interval_button.dart
0 → 100644
浏览文件 @
51ab5a3d
import
'package:flutter/gestures.dart'
;
import
'package:flutter/widgets.dart'
;
class
CLXIntervalBtn
extends
StatelessWidget
with
WidgetInterval
{
CLXIntervalBtn
(
{
super
.
key
,
required
this
.
child
,
interval
=
const
Duration
(
seconds:
1
),
this
.
disabled
=
false
,
this
.
onTap
});
final
Widget
?
child
;
final
bool
disabled
;
final
Function
?
onTap
;
@override
Widget
build
(
BuildContext
context
)
{
return
GestureDetector
(
key:
key
,
onTap:
_onTap
,
child:
child
,
);
}
void
_onTap
()
{
if
(
disabled
)
{
return
;
}
if
(
lastTap
==
null
||
lastTap
?.
add
(
interval
).
compareTo
(
DateTime
.
now
())
==
-
1
)
{
lastTap
=
DateTime
.
now
();
onTap
?.
call
();
}
}
}
class
CLXTapGestureRecognizer
extends
TapGestureRecognizer
with
TapGestureRecognizerInterval
{
@protected
@override
void
handleTapUp
(
{
required
PointerDownEvent
down
,
required
PointerUpEvent
up
})
{
final
TapUpDetails
details
=
TapUpDetails
(
kind:
up
.
kind
,
globalPosition:
up
.
position
,
localPosition:
up
.
localPosition
,
);
final
canTouch
=
lastTap
==
null
||
lastTap
?.
add
(
interval
).
compareTo
(
DateTime
.
now
())
==
-
1
;
if
(!
canTouch
)
{
return
;
}
lastTap
=
DateTime
.
now
();
switch
(
down
.
buttons
)
{
case
kPrimaryButton:
if
(
onTapUp
!=
null
)
{
invokeCallback
<
void
>(
'onTapUp'
,
()
=>
onTapUp
!(
details
));
}
if
(
onTap
!=
null
)
{
invokeCallback
<
void
>(
'onTap'
,
onTap
!);
}
case
kSecondaryButton:
if
(
onSecondaryTapUp
!=
null
)
{
invokeCallback
<
void
>(
'onSecondaryTapUp'
,
()
=>
onSecondaryTapUp
!(
details
));
}
if
(
onSecondaryTap
!=
null
)
{
invokeCallback
<
void
>(
'onSecondaryTap'
,
()
=>
onSecondaryTap
!());
}
case
kTertiaryButton:
if
(
onTertiaryTapUp
!=
null
)
{
invokeCallback
<
void
>(
'onTertiaryTapUp'
,
()
=>
onTertiaryTapUp
!(
details
));
}
default
:
}
}
}
mixin
WidgetInterval
on
Widget
{
Duration
get
interval
=>
_interval
;
Duration
_interval
=
Duration
.
zero
;
DateTime
?
lastTap
;
set
interval
(
Duration
duration
)
{
_interval
=
duration
;
}
}
mixin
TapGestureRecognizerInterval
on
TapGestureRecognizer
{
Duration
get
interval
=>
_interval
;
Duration
_interval
=
const
Duration
(
seconds:
1
);
DateTime
?
lastTap
;
set
interval
(
Duration
duration
)
{
_interval
=
duration
;
}
}
lib/widgets/tips_widget/no_receive_resend_sms_view.dart
浏览文件 @
51ab5a3d
import
'package:clx_verification_code/clx_verification_code.dart'
;
import
'package:flutter/gestures.dart'
;
import
'package:flutter/widgets.dart'
;
...
...
@@ -33,7 +34,7 @@ class NoReceiveResendSmsView extends StatelessWidget {
TextSpan
(
text:
'获取语音验证码'
,
style:
reSendStyle
,
recognizer:
TapGestureRecognizer
()..
onTap
=
sendVoiceCode
,
recognizer:
CLX
TapGestureRecognizer
()..
onTap
=
sendVoiceCode
,
),
],
),
...
...
lib/widgets/tips_widget/no_receive_sms_view.dart
浏览文件 @
51ab5a3d
import
'package:clx_verification_code/clx_verification_code.dart'
;
import
'package:flutter/gestures.dart'
;
import
'package:flutter/widgets.dart'
;
...
...
@@ -43,13 +44,13 @@ class NoReceiveSmsView extends StatelessWidget {
TextSpan
(
text:
'重新获取'
,
style:
reSendStyle
,
recognizer:
TapGestureRecognizer
()..
onTap
=
sendSmsCode
,
recognizer:
CLX
TapGestureRecognizer
()..
onTap
=
sendSmsCode
,
),
],
),
),
const
Spacer
(),
GestureDetector
(
CLXIntervalBtn
(
onTap:
sendVoiceCode
,
child:
Text
(
'获取语音验证码'
,
...
...
lib/widgets/tips_widget/no_receive_voice_view.dart
浏览文件 @
51ab5a3d
import
'package:clx_verification_code/clx_verification_code.dart'
;
import
'package:flutter/gestures.dart'
;
import
'package:flutter/widgets.dart'
;
...
...
@@ -47,7 +48,7 @@ class NoReceiveVoiceView extends StatelessWidget {
TextSpan
(
text:
'重新获取'
,
style:
reSendStyle
,
recognizer:
TapGestureRecognizer
()..
onTap
=
sendVoiceCode
,
recognizer:
CLX
TapGestureRecognizer
()..
onTap
=
sendVoiceCode
,
),
],
),
...
...
@@ -55,7 +56,7 @@ class NoReceiveVoiceView extends StatelessWidget {
),
if
(
isShowContact
)
...[
const
SizedBox
(
width:
10
),
GestureDetector
(
CLXIntervalBtn
(
onTap:
contactService
,
child:
Text
(
'联系人工服务'
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论