Browse Source

优化勾选用户协议和隐私协议体验

weicu
lxm 1 year ago
parent
commit
4da0e04099
  1. 8
      android/app/build.gradle.kts
  2. 63
      lib/modules/login/views/login_view.dart

8
android/app/build.gradle.kts

@ -97,8 +97,8 @@ android {
release { release {
// TODO: Add your own signing config for the release build. // TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works. // Signing with the debug keys for now, so `flutter run --release` works.
isMinifyEnabled = true isMinifyEnabled = false
isShrinkResources = true isShrinkResources = false
proguardFiles( proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"), getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro" "proguard-rules.pro"
@ -107,8 +107,8 @@ android {
// signingConfig = signingConfigs.getByName("debug") // signingConfig = signingConfigs.getByName("debug")
} }
debug { debug {
isMinifyEnabled = true isMinifyEnabled = false
isShrinkResources = true isShrinkResources = false
proguardFiles( proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"), getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro" "proguard-rules.pro"

63
lib/modules/login/views/login_view.dart

@ -526,33 +526,44 @@ class LoginView extends GetView<LoginController> {
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, // 添加这行 crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
SizedBox( // 将勾选框和文本包装在 GestureDetector 中
width: 12.w, GestureDetector(
height: 16.w, onTap: () => controller.hasAcceptedPrivacy =
child: Transform.scale( !controller.hasAcceptedPrivacy,
scale: 0.7, behavior: HitTestBehavior.opaque, // 确保透明区域也能响应点击
child: Obx(() => Checkbox( child: Row(
value: controller.hasAcceptedPrivacy, children: [
onChanged: (value) => SizedBox(
controller.hasAcceptedPrivacy = value ?? false, width: 12.w,
activeColor: const Color(0xFF3B82F6), height: 16.w,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, child: Transform.scale(
visualDensity: VisualDensity.compact, scale: 0.7,
side: BorderSide( child: Obx(() => Checkbox(
width: 1.6, value: controller.hasAcceptedPrivacy,
color: Colors.grey[600]!, onChanged: (value) =>
), controller.hasAcceptedPrivacy = value ?? false,
)), activeColor: const Color(0xFF3B82F6),
), materialTapTargetSize:
), MaterialTapTargetSize.shrinkWrap,
SizedBox(width: 4.w), visualDensity: VisualDensity.compact,
Text( side: BorderSide(
'expressConsent'.tr, width: 1.6,
style: TextStyle( color: Colors.grey[600]!,
fontSize: 13.sp, ),
color: isDarkMode ? Colors.grey[400] : Colors.grey[700], )),
),
),
SizedBox(width: 4.w),
Text(
'expressConsent'.tr,
style: TextStyle(
fontSize: 13.sp,
color: isDarkMode ? Colors.grey[400] : Colors.grey[700],
),
),
],
), ),
), ),
], ],

Loading…
Cancel
Save