From 4da0e040998054c2286d46439836950e5cba1944 Mon Sep 17 00:00:00 2001 From: lxm <1274844347@qq.com> Date: Thu, 24 Apr 2025 20:00:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8B=BE=E9=80=89=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=8D=8F=E8=AE=AE=E5=92=8C=E9=9A=90=E7=A7=81=E5=8D=8F?= =?UTF-8?q?=E8=AE=AE=E4=BD=93=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/app/build.gradle.kts | 8 ++-- lib/modules/login/views/login_view.dart | 63 +++++++++++++++---------- 2 files changed, 41 insertions(+), 30 deletions(-) diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index 609facd8c..be42f1334 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -97,8 +97,8 @@ android { release { // TODO: Add your own signing config for the release build. // Signing with the debug keys for now, so `flutter run --release` works. - isMinifyEnabled = true - isShrinkResources = true + isMinifyEnabled = false + isShrinkResources = false proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" @@ -107,8 +107,8 @@ android { // signingConfig = signingConfigs.getByName("debug") } debug { - isMinifyEnabled = true - isShrinkResources = true + isMinifyEnabled = false + isShrinkResources = false proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" diff --git a/lib/modules/login/views/login_view.dart b/lib/modules/login/views/login_view.dart index 9bc34934b..43776c799 100644 --- a/lib/modules/login/views/login_view.dart +++ b/lib/modules/login/views/login_view.dart @@ -526,33 +526,44 @@ class LoginView extends GetView { children: [ Row( mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, // 添加这行 + crossAxisAlignment: CrossAxisAlignment.center, children: [ - SizedBox( - width: 12.w, - height: 16.w, - child: Transform.scale( - scale: 0.7, - child: Obx(() => Checkbox( - value: controller.hasAcceptedPrivacy, - onChanged: (value) => - controller.hasAcceptedPrivacy = value ?? false, - activeColor: const Color(0xFF3B82F6), - materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, - visualDensity: VisualDensity.compact, - side: BorderSide( - width: 1.6, - color: Colors.grey[600]!, - ), - )), - ), - ), - SizedBox(width: 4.w), - Text( - 'expressConsent'.tr, - style: TextStyle( - fontSize: 13.sp, - color: isDarkMode ? Colors.grey[400] : Colors.grey[700], + // 将勾选框和文本包装在 GestureDetector 中 + GestureDetector( + onTap: () => controller.hasAcceptedPrivacy = + !controller.hasAcceptedPrivacy, + behavior: HitTestBehavior.opaque, // 确保透明区域也能响应点击 + child: Row( + children: [ + SizedBox( + width: 12.w, + height: 16.w, + child: Transform.scale( + scale: 0.7, + child: Obx(() => Checkbox( + value: controller.hasAcceptedPrivacy, + onChanged: (value) => + controller.hasAcceptedPrivacy = value ?? false, + activeColor: const Color(0xFF3B82F6), + materialTapTargetSize: + MaterialTapTargetSize.shrinkWrap, + visualDensity: VisualDensity.compact, + side: BorderSide( + width: 1.6, + color: Colors.grey[600]!, + ), + )), + ), + ), + SizedBox(width: 4.w), + Text( + 'expressConsent'.tr, + style: TextStyle( + fontSize: 13.sp, + color: isDarkMode ? Colors.grey[400] : Colors.grey[700], + ), + ), + ], ), ), ],