Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
ChatGPT
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
关振斌
ChatGPT
Commits
685e9641
Commit
685e9641
authored
Apr 18, 2023
by
skeyboy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录页验证码倒计时/登录页禁用Android侧滑返回
parent
b72d1fa9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
15 deletions
+19
-15
lib/pages/frame/sign_in/controller.dart
lib/pages/frame/sign_in/controller.dart
+4
-1
lib/pages/frame/sign_in/view.dart
lib/pages/frame/sign_in/view.dart
+15
-14
No files found.
lib/pages/frame/sign_in/controller.dart
View file @
685e9641
...
...
@@ -26,6 +26,7 @@ class SignInController extends GetxController {
RxBool
codeEnable
=
false
.
obs
;
RxBool
checkBox
=
false
.
obs
;
RxBool
loginBtnEable
=
false
.
obs
;
RxString
codeTileStr
=
"获取验证码"
.
obs
;
/// 倒计时的计时器。
late
Timer
_timer
;
...
...
@@ -176,11 +177,13 @@ class SignInController extends GetxController {
_seconds
=
60
;
verifyStr
.
value
=
'重新发送'
;
codeEnable
.
value
=
true
;
codeTileStr
.
value
=
"重新发送验证码"
;
return
;
}
_seconds
--;
verifyStr
.
value
=
'已发送
$_seconds
'
+
's'
;
codeTileStr
.
value
=
"
${_seconds}
s后重试"
;
codeEnable
.
value
=
false
;
_seconds
--;
});
}
...
...
lib/pages/frame/sign_in/view.dart
View file @
685e9641
...
...
@@ -590,7 +590,9 @@ class SignInPage extends GetView<SignInController> {
}
Widget
buildAndroidSigin
(
BuildContext
buildContext
)
{
return
GestureDetector
(
return
WillPopScope
(
onWillPop:
()
async
{
return
false
;
},
child:
GestureDetector
(
behavior:
HitTestBehavior
.
translucent
,
onTap:
()
=>
Focus
.
of
(
buildContext
).
unfocus
(),
child:
SingleChildScrollView
(
...
...
@@ -647,7 +649,7 @@ class SignInPage extends GetView<SignInController> {
cursorColor:
kPrimaryColor
,
onSaved:
(
email
)
{},
style:
const
TextStyle
(
color:
Color
(
0xFF6F35A5
)),
const
TextStyle
(
color:
Color
(
0xFF6F35A5
)),
decoration:
const
InputDecoration
(
labelStyle:
TextStyle
(
color:
Colors
.
black
),
fillColor:
kPrimaryLightColor
,
...
...
@@ -655,15 +657,15 @@ class SignInPage extends GetView<SignInController> {
prefixIconColor:
Color
(
0xFF6F35A5
),
filled:
true
,
contentPadding:
EdgeInsets
.
fromLTRB
(
10
,
10
,
10
,
10
),
EdgeInsets
.
fromLTRB
(
10
,
10
,
10
,
10
),
border:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
30
)),
BorderRadius
.
all
(
Radius
.
circular
(
30
)),
borderSide:
BorderSide
.
none
,
),
hintText:
"输入手机号"
,
hintStyle:
TextStyle
(
color:
Color
(
0xFF6F35A5
)),
TextStyle
(
color:
Color
(
0xFF6F35A5
)),
prefixIcon:
Padding
(
padding:
EdgeInsets
.
only
(
left:
defaultPadding
,
...
...
@@ -686,18 +688,18 @@ class SignInPage extends GetView<SignInController> {
labelStyle:
TextStyle
(
color:
Colors
.
black
),
fillColor:
kPrimaryLightColor
,
contentPadding:
EdgeInsets
.
fromLTRB
(
10
,
10
,
10
,
10
),
EdgeInsets
.
fromLTRB
(
10
,
10
,
10
,
10
),
iconColor:
Color
(
0xFF6F35A5
),
prefixIconColor:
Color
(
0xFF6F35A5
),
filled:
true
,
border:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
30
)),
BorderRadius
.
all
(
Radius
.
circular
(
30
)),
borderSide:
BorderSide
.
none
,
),
hintText:
"输入验证码"
,
hintStyle:
TextStyle
(
color:
Color
(
0xFF6F35A5
)),
TextStyle
(
color:
Color
(
0xFF6F35A5
)),
prefixIcon:
Padding
(
padding:
EdgeInsets
.
all
(
defaultPadding
),
child:
Icon
(
Icons
.
lock
),
...
...
@@ -711,11 +713,11 @@ class SignInPage extends GetView<SignInController> {
Flexible
(
child:
Container
()),
GestureDetector
(
onTap:
()
=>
controller
.
chageCodeStatus
(),
child:
const
Text
(
"获取验证码"
,
style:
TextStyle
(
child:
Obx
(()=>
Text
(
controller
.
codeTileStr
.
value
,
style:
const
TextStyle
(
color:
Colors
.
white54
,
fontSize:
12
),
),
)
)
,
)
],
),
...
...
@@ -752,8 +754,7 @@ class SignInPage extends GetView<SignInController> {
),
),
),
);
),);
// return GestureDetector(
// behavior: HitTestBehavior.translucent,
// onTap: () => FocusScope.of(buildContext).unfocus(),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment