|
|
@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; |
|
|
import 'package:get/get.dart'; |
|
|
import 'package:get/get.dart'; |
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
import '../controllers/splash_controller.dart'; |
|
|
import '../controllers/splash_controller.dart'; |
|
|
|
|
|
import '../../common/webview_page.dart'; |
|
|
|
|
|
|
|
|
class SplashView extends GetView<SplashController> { |
|
|
class SplashView extends GetView<SplashController> { |
|
|
const SplashView({Key? key}) : super(key: key); |
|
|
const SplashView({Key? key}) : super(key: key); |
|
|
@ -39,6 +40,14 @@ class SplashView extends GetView<SplashController> { |
|
|
), |
|
|
), |
|
|
), |
|
|
), |
|
|
|
|
|
|
|
|
|
|
|
// 隐私政策组件 - 添加在底部 |
|
|
|
|
|
Positioned( |
|
|
|
|
|
bottom: 90.h, |
|
|
|
|
|
left: 0, |
|
|
|
|
|
right: 0, |
|
|
|
|
|
child: _buildTermsAndPrivacy(isDarkMode), |
|
|
|
|
|
), |
|
|
|
|
|
|
|
|
// 版本号 |
|
|
// 版本号 |
|
|
//_buildVersionInfo(isDarkMode), |
|
|
//_buildVersionInfo(isDarkMode), |
|
|
], |
|
|
], |
|
|
@ -206,6 +215,112 @@ class SplashView extends GetView<SplashController> { |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 用户协议和隐私政策 |
|
|
|
|
|
Widget _buildTermsAndPrivacy(bool isDarkMode) { |
|
|
|
|
|
return Column( |
|
|
|
|
|
children: [ |
|
|
|
|
|
Row( |
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center, |
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
|
|
|
|
children: [ |
|
|
|
|
|
// 将勾选框和文本包装在 GestureDetector 中 |
|
|
|
|
|
GestureDetector( |
|
|
|
|
|
onTap: () => controller.togglePrivacyAcceptance(), |
|
|
|
|
|
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.value, |
|
|
|
|
|
onChanged: (value) => controller |
|
|
|
|
|
.hasAcceptedPrivacy.value = 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], |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
|
|
|
], |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
|
|
|
], |
|
|
|
|
|
), |
|
|
|
|
|
//SizedBox(height: 4.h), |
|
|
|
|
|
Row( |
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center, |
|
|
|
|
|
children: [ |
|
|
|
|
|
GestureDetector( |
|
|
|
|
|
onTap: () { |
|
|
|
|
|
String url = 'https://www.voitrans.net/doc/yhxy.html'; // 用户协议链接 |
|
|
|
|
|
if (Get.locale?.languageCode != 'zh' || |
|
|
|
|
|
Get.locale?.countryCode != 'CN') { |
|
|
|
|
|
url = 'https://www.voitrans.net/doc/yhxy_en.html'; // 用户协议英文链接 |
|
|
|
|
|
} |
|
|
|
|
|
Get.to(() => WebViewPage( |
|
|
|
|
|
url: url, |
|
|
|
|
|
title: 'userAgreement'.tr, |
|
|
|
|
|
)); |
|
|
|
|
|
}, |
|
|
|
|
|
child: Text( |
|
|
|
|
|
'userAgreement'.tr, // 《用户协议》 |
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
|
color: const Color(0xFF3B82F6), |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
|
|
|
Text( |
|
|
|
|
|
'and'.tr, // 和 |
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
|
color: isDarkMode ? Colors.grey[500] : Colors.grey[600], |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
|
|
|
GestureDetector( |
|
|
|
|
|
onTap: () { |
|
|
|
|
|
String url = 'https://www.voitrans.net/doc/ysxy.html'; // 隐私政策链接 |
|
|
|
|
|
|
|
|
|
|
|
if (Get.locale?.languageCode != 'zh' || |
|
|
|
|
|
Get.locale?.countryCode != 'CN') { |
|
|
|
|
|
url = 'https://www.voitrans.net/doc/ysxy_en.html'; // 隐私政策英文链接 |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Get.to(() => WebViewPage( |
|
|
|
|
|
url: url, |
|
|
|
|
|
title: 'privacyPolicy'.tr, |
|
|
|
|
|
)); |
|
|
|
|
|
}, |
|
|
|
|
|
child: Text( |
|
|
|
|
|
'privacyPolicy'.tr, // 《隐私政策》 |
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
|
color: const Color(0xFF3B82F6), |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
|
|
|
], |
|
|
|
|
|
), |
|
|
|
|
|
], |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 版本信息 |
|
|
// 版本信息 |
|
|
// 暂时不需要版本号显示,保留代码以备将来使用 |
|
|
// 暂时不需要版本号显示,保留代码以备将来使用 |
|
|
// Widget _buildVersionInfo(bool isDarkMode) { |
|
|
// Widget _buildVersionInfo(bool isDarkMode) { |
|
|
|