From b49c9e1af58096b44ed582cc43e6439c03c3ee5a Mon Sep 17 00:00:00 2001 From: hailin Date: Sun, 21 Dec 2025 17:59:21 -0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=80=9A=E8=BF=87=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E5=86=85=E8=BE=B9=E8=B7=9D=E8=A7=A3=E5=86=B3=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E7=A0=81=E6=95=B0=E5=AD=97=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=85=A8?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加 contentPadding: EdgeInsets.zero 移除默认内边距 - 添加 isDense: true 使用紧凑模式 - 移除之前错误的 showCursor 逻辑 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../auth/presentation/pages/sms_verify_page.dart | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/frontend/mobile-app/lib/features/auth/presentation/pages/sms_verify_page.dart b/frontend/mobile-app/lib/features/auth/presentation/pages/sms_verify_page.dart index 94e3d6bc..d0f2f0b4 100644 --- a/frontend/mobile-app/lib/features/auth/presentation/pages/sms_verify_page.dart +++ b/frontend/mobile-app/lib/features/auth/presentation/pages/sms_verify_page.dart @@ -232,13 +232,12 @@ class _SmsVerifyPageState extends ConsumerState { } void _onCodeChanged(int index, String value) { - // 每次输入都触发重建,以更新 showCursor 状态 - setState(() { - // 清除错误信息 - if (_errorMessage != null) { + // 清除错误信息 + if (_errorMessage != null) { + setState(() { _errorMessage = null; - } - }); + }); + } if (value.isNotEmpty) { // 输入了字符,移动到下一个 @@ -378,7 +377,6 @@ class _SmsVerifyPageState extends ConsumerState { keyboardType: TextInputType.number, textAlign: TextAlign.center, maxLength: 1, - showCursor: _controllers[index].text.isEmpty, // 空时显示光标,有内容时隐藏避免遮挡数字 inputFormatters: [ FilteringTextInputFormatter.digitsOnly, ], @@ -386,6 +384,8 @@ class _SmsVerifyPageState extends ConsumerState { counterText: '', filled: true, fillColor: const Color(0xFFF5F5F5), + contentPadding: EdgeInsets.zero, // 移除内边距,让数字完整居中显示 + isDense: true, border: OutlineInputBorder( borderRadius: BorderRadius.circular(12.r), borderSide: BorderSide.none,