2023-07-18 18:10:57 +08:00
|
|
|
import 'package:flutter/material.dart';
|
2023-07-21 19:31:01 +08:00
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
2023-07-18 18:10:57 +08:00
|
|
|
import 'package:get/get.dart';
|
2024-07-16 16:40:52 +08:00
|
|
|
import 'package:package_info_plus/package_info_plus.dart';
|
2023-10-12 13:50:01 +08:00
|
|
|
import 'package:star_lock/appRouters.dart';
|
2023-10-18 11:42:27 +08:00
|
|
|
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
2024-04-29 16:18:43 +08:00
|
|
|
import 'package:star_lock/mine/about/about_console.dart';
|
2023-07-18 18:10:57 +08:00
|
|
|
|
|
|
|
|
import '../../app_settings/app_colors.dart';
|
2024-01-27 16:05:17 +08:00
|
|
|
import '../../flavors.dart';
|
2023-07-21 19:31:01 +08:00
|
|
|
import '../../tools/commonItem.dart';
|
2023-07-18 18:10:57 +08:00
|
|
|
import '../../tools/titleAppBar.dart';
|
|
|
|
|
|
2024-01-23 17:21:04 +08:00
|
|
|
class AboutPage extends StatefulWidget {
|
|
|
|
|
const AboutPage({Key? key}) : super(key: key);
|
2023-07-18 18:10:57 +08:00
|
|
|
|
|
|
|
|
@override
|
2024-01-23 17:21:04 +08:00
|
|
|
State<AboutPage> createState() => _AboutPageState();
|
2023-07-18 18:10:57 +08:00
|
|
|
}
|
|
|
|
|
|
2024-01-23 17:21:04 +08:00
|
|
|
class _AboutPageState extends State<AboutPage> {
|
2024-03-04 10:11:25 +08:00
|
|
|
late PackageInfo packageInfo;
|
2024-07-16 16:40:52 +08:00
|
|
|
String appName = '';
|
|
|
|
|
String packageName = '';
|
|
|
|
|
String version = '-----';
|
|
|
|
|
String buildNumber = '---';
|
2024-03-04 10:11:25 +08:00
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
super.initState();
|
2024-12-04 13:55:58 +08:00
|
|
|
// AppLog.log('Get.locale!: ${Get.locale.toString()}');
|
|
|
|
|
|
2024-03-04 10:11:25 +08:00
|
|
|
initPackageInfo();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<void> initPackageInfo() async {
|
|
|
|
|
packageInfo = await PackageInfo.fromPlatform();
|
|
|
|
|
setState(() {
|
|
|
|
|
appName = packageInfo.appName;
|
|
|
|
|
packageName = packageInfo.packageName;
|
|
|
|
|
version = packageInfo.version;
|
|
|
|
|
buildNumber = packageInfo.buildNumber;
|
|
|
|
|
});
|
|
|
|
|
}
|
2024-03-05 09:30:53 +08:00
|
|
|
|
2023-07-18 18:10:57 +08:00
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
2024-04-29 16:18:43 +08:00
|
|
|
return GetBuilder<AboutConsole>(
|
|
|
|
|
init: AboutConsole(),
|
|
|
|
|
builder: (AboutConsole logic) {
|
|
|
|
|
return Scaffold(
|
|
|
|
|
backgroundColor: AppColors.mainBackgroundColor,
|
2024-04-30 09:51:12 +08:00
|
|
|
appBar: F.sw(
|
2024-05-28 10:40:17 +08:00
|
|
|
skyCall: () => TitleAppBar(
|
2024-08-01 18:54:32 +08:00
|
|
|
barTitle: '关于'.tr,
|
2024-04-29 16:18:43 +08:00
|
|
|
haveBack: true,
|
2024-04-30 09:51:12 +08:00
|
|
|
backgroundColor: AppColors.mainColor,
|
|
|
|
|
),
|
|
|
|
|
xhjCall: () => TitleAppBar(
|
2024-08-01 18:54:32 +08:00
|
|
|
barTitle: '关于'.tr,
|
2024-04-30 09:51:12 +08:00
|
|
|
haveBack: true,
|
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
|
iconColor: AppColors.blackColor,
|
|
|
|
|
titleColor: AppColors.blackColor,
|
|
|
|
|
),
|
|
|
|
|
),
|
2024-04-29 16:18:43 +08:00
|
|
|
body: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
children: [
|
2024-07-16 16:40:52 +08:00
|
|
|
F.sw(skyCall: logoView, xhjCall: () => const SizedBox()),
|
2024-04-30 09:32:06 +08:00
|
|
|
listView(),
|
2024-07-16 16:40:52 +08:00
|
|
|
F.sw(skyCall: () => const SizedBox(), xhjCall: logoView),
|
2024-04-29 16:18:43 +08:00
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
});
|
2023-07-18 18:10:57 +08:00
|
|
|
}
|
2024-04-30 09:32:06 +08:00
|
|
|
|
|
|
|
|
//列表
|
|
|
|
|
Widget listView() {
|
|
|
|
|
Widget view = Column(
|
|
|
|
|
children: [
|
|
|
|
|
CommonItem(
|
2024-08-01 18:54:32 +08:00
|
|
|
leftTitel: '介绍'.tr,
|
2024-07-16 16:40:52 +08:00
|
|
|
rightTitle: '',
|
2024-04-30 09:32:06 +08:00
|
|
|
isHaveLine: false,
|
|
|
|
|
isHaveDirection: true,
|
|
|
|
|
action: () {
|
|
|
|
|
Navigator.pushNamed(context, Routers.webviewShowPage, arguments: {
|
2024-12-04 13:55:58 +08:00
|
|
|
'url': XSConstantMacro.introduceURL +
|
|
|
|
|
'?lang=${Get.locale!.toString()}',
|
2024-07-16 16:40:52 +08:00
|
|
|
'title': '介绍'.tr
|
2024-04-30 09:32:06 +08:00
|
|
|
});
|
|
|
|
|
}),
|
|
|
|
|
Divider(
|
|
|
|
|
height: 1,
|
|
|
|
|
color: AppColors.greyLineColor,
|
|
|
|
|
indent: 20.w,
|
|
|
|
|
endIndent: 20.w,
|
|
|
|
|
),
|
|
|
|
|
CommonItem(
|
2024-09-02 18:09:57 +08:00
|
|
|
leftTitel: '用户协议'.tr,
|
2024-07-16 16:40:52 +08:00
|
|
|
rightTitle: '',
|
2024-04-30 09:32:06 +08:00
|
|
|
isHaveLine: false,
|
|
|
|
|
isHaveDirection: true,
|
|
|
|
|
action: () {
|
|
|
|
|
Get.toNamed(Routers.webviewShowPage, arguments: {
|
2024-12-04 13:55:58 +08:00
|
|
|
'url': XSConstantMacro.userAgreementURL +
|
|
|
|
|
'?lang=${Get.locale!.toString()}',
|
2024-07-16 16:40:52 +08:00
|
|
|
'title': '用户协议'.tr
|
2024-04-30 09:32:06 +08:00
|
|
|
});
|
|
|
|
|
}),
|
|
|
|
|
Divider(
|
|
|
|
|
height: 1,
|
|
|
|
|
color: AppColors.greyLineColor,
|
|
|
|
|
indent: 20.w,
|
|
|
|
|
endIndent: 20.w,
|
|
|
|
|
),
|
|
|
|
|
CommonItem(
|
2024-08-01 18:54:32 +08:00
|
|
|
leftTitel: '隐私政策'.tr,
|
2024-07-16 16:40:52 +08:00
|
|
|
rightTitle: '',
|
2024-04-30 09:32:06 +08:00
|
|
|
isHaveLine: false,
|
|
|
|
|
isHaveDirection: true,
|
|
|
|
|
action: () {
|
|
|
|
|
Navigator.pushNamed(context, Routers.webviewShowPage, arguments: {
|
2024-12-04 13:55:58 +08:00
|
|
|
'url': XSConstantMacro.privacyPolicyURL +
|
|
|
|
|
'?lang=${Get.locale!.toString()}',
|
2024-07-16 16:40:52 +08:00
|
|
|
'title': '隐私政策'.tr
|
2024-04-30 09:32:06 +08:00
|
|
|
});
|
|
|
|
|
}),
|
|
|
|
|
Divider(
|
|
|
|
|
height: 1,
|
|
|
|
|
color: AppColors.greyLineColor,
|
|
|
|
|
indent: 20.w,
|
|
|
|
|
endIndent: 20.w,
|
|
|
|
|
),
|
|
|
|
|
CommonItem(
|
2024-08-01 18:54:32 +08:00
|
|
|
leftTitel: '个人信息收集清单'.tr,
|
2024-07-16 16:40:52 +08:00
|
|
|
rightTitle: '',
|
2024-04-30 09:32:06 +08:00
|
|
|
isHaveLine: false,
|
|
|
|
|
isHaveDirection: true,
|
|
|
|
|
action: () {
|
|
|
|
|
Navigator.pushNamed(context, Routers.webviewShowPage, arguments: {
|
2024-12-04 13:55:58 +08:00
|
|
|
'url': XSConstantMacro.collectionListURL +
|
|
|
|
|
'?lang=${Get.locale!.toString()}',
|
2024-07-16 16:40:52 +08:00
|
|
|
'title': '个人信息收集清单'.tr
|
2024-04-30 09:32:06 +08:00
|
|
|
});
|
|
|
|
|
}),
|
|
|
|
|
Divider(
|
|
|
|
|
height: 1,
|
|
|
|
|
color: AppColors.greyLineColor,
|
|
|
|
|
indent: 20.w,
|
|
|
|
|
endIndent: 20.w,
|
|
|
|
|
),
|
|
|
|
|
CommonItem(
|
2024-12-04 13:55:58 +08:00
|
|
|
leftTitel: '应用权限说明'.tr,
|
2024-07-16 16:40:52 +08:00
|
|
|
rightTitle: '',
|
2024-04-30 09:32:06 +08:00
|
|
|
isHaveLine: false,
|
|
|
|
|
isHaveDirection: true,
|
|
|
|
|
action: () {
|
|
|
|
|
Navigator.pushNamed(context, Routers.webviewShowPage, arguments: {
|
2024-12-04 13:55:58 +08:00
|
|
|
'url': XSConstantMacro.appPermissionDescURL +
|
|
|
|
|
'?lang=${Get.locale!.toString()}',
|
2024-07-16 16:40:52 +08:00
|
|
|
'title': '应用权限说明'.tr
|
2024-04-30 09:32:06 +08:00
|
|
|
});
|
|
|
|
|
}),
|
|
|
|
|
Divider(
|
|
|
|
|
height: 1,
|
|
|
|
|
color: AppColors.greyLineColor,
|
|
|
|
|
indent: 20.w,
|
|
|
|
|
endIndent: 20.w,
|
|
|
|
|
),
|
|
|
|
|
CommonItem(
|
2024-12-04 13:55:58 +08:00
|
|
|
leftTitel: '第三方信息共享清单'.tr,
|
2024-07-16 16:40:52 +08:00
|
|
|
rightTitle: '',
|
2024-04-30 09:32:06 +08:00
|
|
|
isHaveLine: false,
|
|
|
|
|
isHaveDirection: true,
|
|
|
|
|
action: () {
|
|
|
|
|
Navigator.pushNamed(context, Routers.webviewShowPage, arguments: {
|
2024-12-04 13:55:58 +08:00
|
|
|
'url': XSConstantMacro.thirdPartyInfShareListURL +
|
|
|
|
|
'?lang=${Get.locale!.toString()}',
|
2024-07-16 16:40:52 +08:00
|
|
|
'title': '第三方信息共享清单'.tr
|
2024-04-30 09:32:06 +08:00
|
|
|
});
|
|
|
|
|
}),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
view = F.sw(
|
2024-05-28 10:40:17 +08:00
|
|
|
skyCall: () => view,
|
2024-04-30 09:32:06 +08:00
|
|
|
xhjCall: () => Container(
|
|
|
|
|
margin: EdgeInsets.only(top: 20.h, left: 20.w, right: 20.w),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(20.r))),
|
|
|
|
|
child: ClipRRect(
|
|
|
|
|
borderRadius: BorderRadius.circular(20.r),
|
|
|
|
|
child: view,
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
return view;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//图标
|
|
|
|
|
Widget logoView() {
|
|
|
|
|
return GetBuilder<AboutConsole>(builder: (AboutConsole logic) {
|
|
|
|
|
return Padding(
|
|
|
|
|
padding: EdgeInsets.only(top: 70.h, bottom: 60.h),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Align(
|
|
|
|
|
alignment: Alignment.topRight,
|
|
|
|
|
child: GestureDetector(
|
|
|
|
|
onTap: logic.handleTap,
|
|
|
|
|
child: Container(
|
|
|
|
|
color: Colors.transparent,
|
|
|
|
|
width: 80.w,
|
|
|
|
|
height: 80.h,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
2024-09-02 18:09:57 +08:00
|
|
|
GestureDetector(
|
|
|
|
|
onTap: logic.handleTap,
|
|
|
|
|
child: ClipRRect(
|
|
|
|
|
borderRadius: BorderRadius.circular(20.r),
|
|
|
|
|
child: Image.asset(
|
|
|
|
|
F.sw(
|
|
|
|
|
skyCall: () => 'images/icon_main_sky_1024.png',
|
|
|
|
|
xhjCall: () => 'images/icon_main_xhj_1024.png'),
|
|
|
|
|
width: 160.w,
|
|
|
|
|
height: 160.w),
|
|
|
|
|
),
|
2024-04-30 09:32:06 +08:00
|
|
|
),
|
|
|
|
|
SizedBox(height: 20.h),
|
|
|
|
|
Text(
|
2024-07-16 16:40:52 +08:00
|
|
|
'${F.title} $version+$buildNumber',
|
2024-04-30 09:32:06 +08:00
|
|
|
style: TextStyle(fontSize: 24.sp, color: AppColors.blackColor),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 20.h),
|
|
|
|
|
Text(
|
|
|
|
|
F.apiPrefix,
|
|
|
|
|
style: TextStyle(fontSize: 24.sp, color: AppColors.blackColor),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
}
|
2023-07-18 18:10:57 +08:00
|
|
|
}
|