app-starlock/lib/mine/mine/safeVerify/safeVerify_state.dart
魏少阳 15af50d951 1、完善星锁APP国际化 36种语言。
2、修复国际化问题
2024-10-15 18:32:11 +08:00

46 lines
1.4 KiB
Dart
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:star_lock/login/login/entity/LoginData.dart';
class SafeVerifyState {
SafeVerifyState() {
resetResend();
}
final TextEditingController codeController = TextEditingController();
static int currentTimeMillis() {
return DateTime.now().millisecondsSinceEpoch;
}
RxString countryCode = '+86'.obs;
RxString countryId = '9'.obs;
RxString codeType = '5'.obs; // //1注册2找回密码3绑定手机号4解绑手机换绑5删除账号6 绑定邮箱7解绑邮箱换绑
RxString verificationCode = ''.obs;
RxString xWidth = ''.obs; // 滑动验证码滑动位置
RxBool canSub = false.obs;
RxString date = currentTimeMillis().toString().obs;
RxString accountStr = ''.obs;
RxString toggleStr = ''.obs; //可切换字眼
RxBool isToggle = false.obs; //是否点击切换
RxString channel = '1'.obs; //短信通道 1 短信2 邮箱
bool get codeIsOK => verificationCode.value.isNotEmpty;
RxBool canResend = false.obs;
RxString btnText = ''.obs;
int totalSeconds = 120;
int currentSecond = 120;
final Rx<LoginData> loginData = LoginData().obs;
void resetResend() {
canResend.value = totalSeconds == currentSecond;
btnText.value = !canResend.value
? '$currentSecond s'
: btnText.value = '获取验证码'.tr;
}
void onClose() {}
}