FondleTalk/lib/tools/me/about_page.dart
2024-07-26 13:26:09 +08:00

73 lines
1.8 KiB
Dart

import 'package:flutter/material.dart';
import 'package:package_info_plus/package_info_plus.dart';
class AboutPage extends StatefulWidget {
const AboutPage({super.key});
@override
State<AboutPage> createState() => _AboutPageState();
}
class _AboutPageState extends State<AboutPage> {
String version = '';
@override
void initState() {
// TODO: implement initState
super.initState();
getCode();
}
getCode() async {
PackageInfo packageInfo = await PackageInfo.fromPlatform();
String appName = packageInfo.appName;
String packageName = packageInfo.packageName;
version = packageInfo.version;
String buildNumber = packageInfo.buildNumber;
setState(() {});
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color(0xFF121213),
appBar: AppBar(
backgroundColor: Color(0xFF121213),
scrolledUnderElevation: 0.0,
title: Text(
'关于',
style: TextStyle(fontSize: 16, color: Colors.white),
),
centerTitle: true,
leading: IconButton(
iconSize: 18,
icon: Icon(Icons.arrow_back_ios_sharp),
color: Colors.white,
onPressed: () {
// 处理返回操作
Navigator.pop(context);
},
),
),
body: Column(
children: [
Container(
alignment: Alignment.center,
margin: EdgeInsets.only(top: 68),
child: Image(width: 70, height: 70, image: AssetImage('assets/images/ic_launcher.png')),
),
Container(
margin: EdgeInsets.only(top: 17),
child: Text(
version,
style: TextStyle(fontSize: 12, color: Color(0xFF858585)),
),
)
],
),
);
}
}