Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

验证码按钮状态更改问题 #30

Closed
chenjinguang opened this issue Jul 29, 2019 · 5 comments
Closed

验证码按钮状态更改问题 #30

chenjinguang opened this issue Jul 29, 2019 · 5 comments

Comments

@chenjinguang
Copy link

现在代码中是点击发送验证码按钮直接倒计时,正常的开发流程中,是先网络请求验证码发送成功后,才进行倒计时,请问这里该怎么修改呢

@simplezhli
Copy link
Owner

这是我实际项目中的代码,你可以参考一下:
image

图中的getVCode 方法是一个 Future<bool> Function() ,这里你就可以传入你的请求验证码接口。只有当成功时,才会开始倒计时。

@chenjinguang
Copy link
Author

按照您上面说的,我这边的isSuccess一直返回null
image
image

@simplezhli
Copy link
Owner

详细的我就不多说了,主要还是Future的用法问题。代码贴出来,你自己研究一下:
image

image

simplezhli added a commit that referenced this issue Jul 30, 2019
@simplezhli
Copy link
Owner

@chenjinguang 我补充了一下代码,你可以参考一下:https://github.com/simplezhli/flutter_deer/blob/master/lib/login/register_page.dart#L100

@chenjinguang
Copy link
Author

谢谢^_^

  • [ ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants