89 lines
2.3 KiB
Dart
89 lines
2.3 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: Stack(
|
|
alignment: Alignment.center,
|
|
children: [
|
|
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)),
|
|
),
|
|
)
|
|
],
|
|
),
|
|
Positioned(
|
|
bottom: 50,
|
|
child: GestureDetector(
|
|
onTap: () {
|
|
Navigator.pushNamed(context, "/AlgorithmFilingPage");
|
|
},
|
|
child: Text(
|
|
'算法备案',
|
|
style: TextStyle(color: Colors.grey),
|
|
),
|
|
)),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|