Open toknT opened 11 months ago
Android
全屏模式,点击其他登录方式前,先提醒同意用户协议.
Future<void> _aliSmsOnEvent(AuthResponseModel responseModel) async { final AuthResultCode resultCode = AuthResultCode.fromCode( responseModel.resultCode!, ); switch (resultCode) { case AuthResultCode.success: if (responseModel.token != null && responseModel.token!.isNotEmpty) { String aliAuthToken = responseModel.token ?? ''; if (aliAuthToken != '') { _loginViaPhone(aliAuthToken); } else { showToast(context: context, message: '登录出错'); } } break; case AuthResultCode.envCheckSuccess: setState(() { _isSupportAliSimLogin = true; }); break; case AuthResultCode.onCustomViewTap: print(responseModel.msg); if (_hasCheckAgreement == false) { showToast(context: context, message: '先同意用户协议'); return; } switch (responseModel.msg) { case '2': _loginViaWechat(); break; case '3': _loginViaApple(); break; case '4': _loginViaSmsCode(); break; } break; case AuthResultCode.loginControllerClickCheckBoxBtn: _hasCheckAgreement = !_hasCheckAgreement; break; default: print('ali sim auth event:'); print(responseModel.innerCode); print(responseModel.toString()); break; } } bool _hasCheckAgreement = false;
目前在onCustomViewTap判断_hasCheckAgreement是否同意的但全屏登录页还是会被自动关闭
onCustomViewTap
_hasCheckAgreement
Platforms
Android
Description
全屏模式,点击其他登录方式前,先提醒同意用户协议.
My code
Try do it
目前在
onCustomViewTap
判断_hasCheckAgreement
是否同意的但全屏登录页还是会被自动关闭