app-starlock/star_lock/lib/mine/about/about_page.dart

185 lines
6.0 KiB
Dart
Raw Normal View History

2023-07-18 18:10:57 +08:00
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
2023-07-18 18:10:57 +08:00
import 'package:get/get.dart';
2023-10-12 13:50:01 +08:00
import 'package:star_lock/appRouters.dart';
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
import 'package:package_info_plus/package_info_plus.dart';
2023-07-18 18:10:57 +08:00
import '../../app_settings/app_colors.dart';
import '../../flavors.dart';
import '../../tools/commonItem.dart';
2023-07-18 18:10:57 +08:00
import '../../tools/titleAppBar.dart';
import '../../translations/trans_lib.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> {
late PackageInfo packageInfo;
String appName = "";
String packageName = "";
String version = "-----";
String buildNumber = "---";
@override
void initState() {
super.initState();
initPackageInfo();
}
Future<void> initPackageInfo() async {
packageInfo = await PackageInfo.fromPlatform();
setState(() {
appName = packageInfo.appName;
packageName = packageInfo.packageName;
version = packageInfo.version;
buildNumber = packageInfo.buildNumber;
print("aboutGetversion:${version}");
});
}
2023-07-18 18:10:57 +08:00
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(
barTitle: TranslationLoader.lanKeys!.about!.tr,
haveBack: true,
backgroundColor: AppColors.mainColor),
2023-07-18 18:10:57 +08:00
body: Column(
crossAxisAlignment: CrossAxisAlignment.center,
2023-07-18 18:10:57 +08:00
children: [
2023-11-27 09:57:53 +08:00
SizedBox(height: 150.h),
Row(mainAxisAlignment: MainAxisAlignment.center, children: [
Image.asset("images/icon_main_1024.png",
width: 160.w, height: 160.w),
]),
2023-11-27 09:57:53 +08:00
SizedBox(height: 20.h),
2023-07-28 17:14:11 +08:00
Text(
"${F.title} ${version}+${buildNumber}",
2023-07-28 17:14:11 +08:00
style: TextStyle(fontSize: 24.sp, color: AppColors.blackColor),
),
2024-01-23 17:19:32 +08:00
SizedBox(height: 20.h),
Text(
F.apiPrefix,
2024-01-23 17:19:32 +08:00
style: TextStyle(fontSize: 24.sp, color: AppColors.blackColor),
),
SizedBox(
2023-07-28 17:14:11 +08:00
height: 60.h,
),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.introduce!.tr,
rightTitle: "",
isHaveLine: false,
isHaveDirection: true,
2023-10-13 15:37:24 +08:00
action: () {
Navigator.pushNamed(context, Routers.webviewShowPage,
arguments: {
"url": XSConstantMacro.introduceURL,
"title": '介绍'
});
2023-10-13 15:37:24 +08:00
}),
Divider(
height: 1,
color: AppColors.greyLineColor,
indent: 20.w,
endIndent: 20.w,
),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.userAgreement!.tr,
rightTitle: "",
isHaveLine: false,
isHaveDirection: true,
2023-10-12 13:50:01 +08:00
action: () {
2024-01-17 18:43:34 +08:00
print("用户协议${XSConstantMacro.userAgreementURL}");
2023-10-12 13:50:01 +08:00
Navigator.pushNamed(context, Routers.webviewShowPage,
arguments: {
"url": XSConstantMacro.userAgreementURL,
2023-10-12 13:50:01 +08:00
"title": '用户协议'
});
}),
Divider(
height: 1,
color: AppColors.greyLineColor,
indent: 20.w,
endIndent: 20.w,
),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.privacyPolicy!.tr,
rightTitle: "",
isHaveLine: false,
isHaveDirection: true,
2023-10-12 13:50:01 +08:00
action: () {
Navigator.pushNamed(context, Routers.webviewShowPage,
arguments: {
"url": XSConstantMacro.privacyPolicyURL,
2023-10-12 13:50:01 +08:00
"title": '隐私政策'
});
}),
Divider(
height: 1,
color: AppColors.greyLineColor,
indent: 20.w,
endIndent: 20.w,
),
CommonItem(
leftTitel: TranslationLoader
.lanKeys!.personalInformationCollectionList!.tr,
rightTitle: "",
isHaveLine: false,
isHaveDirection: true,
2023-10-13 15:37:24 +08:00
action: () {
Navigator.pushNamed(context, Routers.webviewShowPage,
arguments: {
"url": XSConstantMacro.collectionListURL,
"title": '个人信息收集清单'
});
2023-10-13 15:37:24 +08:00
}),
Divider(
height: 1,
color: AppColors.greyLineColor,
indent: 20.w,
endIndent: 20.w,
),
CommonItem(
leftTitel: TranslationLoader
.lanKeys!.applicationPermissionDescription!.tr,
rightTitle: "",
isHaveLine: false,
isHaveDirection: true,
2023-10-13 15:37:24 +08:00
action: () {
Navigator.pushNamed(context, Routers.webviewShowPage,
arguments: {
"url": XSConstantMacro.appPermissionDescURL,
"title": '应用权限说明'
});
2023-10-13 15:37:24 +08:00
}),
Divider(
height: 1,
color: AppColors.greyLineColor,
indent: 20.w,
endIndent: 20.w,
),
CommonItem(
leftTitel: TranslationLoader
.lanKeys!.thirdPartyInformationSharingList!.tr,
rightTitle: "",
isHaveLine: false,
isHaveDirection: true,
2023-10-13 15:37:24 +08:00
action: () {
Navigator.pushNamed(context, Routers.webviewShowPage,
arguments: {
"url": XSConstantMacro.thirdPartyInfShareListURL,
"title": '第三方信息共享清单'
});
2023-10-13 15:37:24 +08:00
}),
2023-07-18 18:10:57 +08:00
],
),
);
}
}