修正在不是游客模式下,登录注册界面无法输入问题。为注册页面的所有输入框添加独立的 FocusNode,并确保正确的焦点切换
This commit is contained in:
parent
b11d5a6001
commit
15d2e1047b
@ -23,8 +23,8 @@ class KRDomain {
|
||||
static const String kr_domainKey = "kr_base_domain";
|
||||
static const String kr_domainsKey = "kr_domains_list";
|
||||
|
||||
static List<String> kr_baseDomains = ["apicn.bearvpn.top","apibear.nsdsox.com"];
|
||||
static String kr_currentDomain = "apicn.bearvpn.top";
|
||||
static List<String> kr_baseDomains = ["api.maodag.top","api.maodag.top"];
|
||||
static String kr_currentDomain = "api.maodag.top";
|
||||
|
||||
// static List<String> kr_baseDomains = ["api.kkmen.cc"];
|
||||
// static String kr_currentDomain = "api.kkmen.cc";
|
||||
@ -1039,7 +1039,7 @@ class AppConfig {
|
||||
/// 请求域名地址
|
||||
String get baseUrl {
|
||||
if (kDebugMode) {
|
||||
return "http://192.168.0.113:8082";
|
||||
return "https://api.maodag.top";
|
||||
}
|
||||
return "${KRProtocol.kr_https}://${KRDomain.kr_api}";
|
||||
}
|
||||
|
||||
@ -121,6 +121,10 @@ class KRLoginController extends GetxController
|
||||
|
||||
// 添加 FocusNode
|
||||
late FocusNode kr_accountFocusNode;
|
||||
late FocusNode kr_passwordFocusNode;
|
||||
late FocusNode kr_confirmPasswordFocusNode;
|
||||
late FocusNode kr_codeFocusNode;
|
||||
late FocusNode kr_inviteCodeFocusNode;
|
||||
|
||||
// 添加获取按钮文本的方法
|
||||
String kr_getNextBtnText() {
|
||||
@ -161,6 +165,10 @@ class KRLoginController extends GetxController
|
||||
|
||||
// 初始化 FocusNode
|
||||
kr_accountFocusNode = FocusNode();
|
||||
kr_passwordFocusNode = FocusNode();
|
||||
kr_confirmPasswordFocusNode = FocusNode();
|
||||
kr_codeFocusNode = FocusNode();
|
||||
kr_inviteCodeFocusNode = FocusNode();
|
||||
|
||||
// 监听 kr_loginStatus 的变化
|
||||
ever(kr_loginStatus, (status) {
|
||||
@ -603,6 +611,10 @@ class KRLoginController extends GetxController
|
||||
animationController.dispose();
|
||||
inviteCodeController.dispose();
|
||||
kr_accountFocusNode.dispose();
|
||||
kr_passwordFocusNode.dispose();
|
||||
kr_confirmPasswordFocusNode.dispose();
|
||||
kr_codeFocusNode.dispose();
|
||||
kr_inviteCodeFocusNode.dispose();
|
||||
super.onClose();
|
||||
}
|
||||
|
||||
|
||||
@ -1034,6 +1034,7 @@ class KRLoginView extends GetView<KRLoginController> {
|
||||
SizedBox(width: 8.w),
|
||||
Expanded(
|
||||
child: TextField(
|
||||
focusNode: controller.kr_inviteCodeFocusNode,
|
||||
controller: controller.inviteCodeController,
|
||||
decoration: InputDecoration(
|
||||
hintText: AppTranslations.kr_login.enterInviteCode,
|
||||
@ -1253,6 +1254,7 @@ class KRLoginView extends GetView<KRLoginController> {
|
||||
SizedBox(width: 8.w),
|
||||
Expanded(
|
||||
child: TextField(
|
||||
focusNode: controller.kr_accountFocusNode,
|
||||
controller: controller.accountController,
|
||||
keyboardType: TextInputType.emailAddress,
|
||||
decoration: InputDecoration(
|
||||
@ -1340,6 +1342,7 @@ class KRLoginView extends GetView<KRLoginController> {
|
||||
SizedBox(width: 8.w),
|
||||
Expanded(
|
||||
child: TextField(
|
||||
focusNode: controller.kr_codeFocusNode,
|
||||
controller: controller.codeController,
|
||||
keyboardType: TextInputType.number,
|
||||
decoration: InputDecoration(
|
||||
@ -1393,6 +1396,7 @@ class KRLoginView extends GetView<KRLoginController> {
|
||||
SizedBox(width: 8.w),
|
||||
Expanded(
|
||||
child: Obx(() => TextField(
|
||||
focusNode: controller.kr_passwordFocusNode,
|
||||
controller: controller.psdController,
|
||||
obscureText: controller.kr_obscureText.value,
|
||||
keyboardType: TextInputType.text,
|
||||
@ -1450,6 +1454,7 @@ class KRLoginView extends GetView<KRLoginController> {
|
||||
SizedBox(width: 8.w),
|
||||
Expanded(
|
||||
child: Obx(() => TextField(
|
||||
focusNode: controller.kr_confirmPasswordFocusNode,
|
||||
controller: controller.agPsdController,
|
||||
obscureText: controller.kr_obscureText.value,
|
||||
keyboardType: TextInputType.text,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user