# Conflicts:
#	star_lock/lib/mine/about/about_page.dart
#	star_lock/pubspec.yaml
This commit is contained in:
魏少阳 2024-03-05 09:30:53 +08:00
commit f3ffea773a
2 changed files with 31 additions and 10 deletions

View File

@ -3,13 +3,13 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_lock/appRouters.dart';
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
import 'package:package_info_plus/package_info_plus.dart';
import '../../app_settings/app_colors.dart';
import '../../flavors.dart';
import '../../tools/commonItem.dart';
import '../../tools/titleAppBar.dart';
import '../../translations/trans_lib.dart';
import '../../network/api.dart';
class AboutPage extends StatefulWidget {
const AboutPage({Key? key}) : super(key: key);
@ -19,6 +19,28 @@ class AboutPage extends StatefulWidget {
}
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;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
@ -31,15 +53,13 @@ class _AboutPageState extends State<AboutPage> {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(height: 150.h),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset("images/icon_main_1024.png", width: 160.w, height: 160.w),
]
),
Row(mainAxisAlignment: MainAxisAlignment.center, children: [
Image.asset("images/icon_main_1024.png",
width: 160.w, height: 160.w),
]),
SizedBox(height: 20.h),
Text(
"${F.title} 1.0.0.11(preRelease-20240301)",
"${F.title} ${version}+${buildNumber}",
style: TextStyle(fontSize: 24.sp, color: AppColors.blackColor),
),
SizedBox(height: 20.h),

View File

@ -17,7 +17,8 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 1.0.0+11
version: 1.0.10+20240201
environment:
sdk: '>=2.12.0 <3.0.0'
@ -54,7 +55,7 @@ dependencies:
# 屏幕适配
flutter_screenutil: ^5.6.0
# 获取当前项目信息
package_info_plus: ^3.0.1
package_info_plus: ^5.0.1
# 选择日期时间
flutter_cupertino_datetime_picker: ^3.0.0
# 选择原生通讯录