SteamCloudGame/lib/tools/me/set/about_page.dart
2024-11-24 15:06:52 +08:00

95 lines
2.6 KiB
Dart

import 'package:flutter/material.dart';
import 'package:package_info/package_info.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();
_initData();
}
void _initData() async {
PackageInfo packageInfo = await PackageInfo.fromPlatform();
String version = packageInfo.version;
setState(() {
this.version = version;
//vInfo = Platform.isIOS ? 'iOS_$version' : 'android_$version';
});
}
@override
Widget build(BuildContext context) {
final size = MediaQuery.of(context).size;
final h50 = size.width / 7.2;
final s16 = size.width / 22.5;
final l14 = size.width / 25.71428571428571;
final w19 = size.width / 18.94736842105263;
final h26 = size.width / 13.84615384615385;
final w57 = size.width / 6.315789473684211;
final t18 = size.width / 20;
return Scaffold(
backgroundColor: const Color(0xFF17181A),
body: Column(
children: [
Container(
width: size.width,
height: h50,
margin: EdgeInsets.only(top: MediaQuery.of(context).padding.top),
child: Stack(
alignment: Alignment.center,
children: [
Text(
"关于我们",
style: TextStyle(fontSize: s16, color: Color(0xFFD6D6D7)),
),
Positioned(
left: l14,
child: GestureDetector(
onTap: () {
Navigator.pop(context);
},
child: Image(
width: w19,
height: h26,
image: AssetImage('assets/images/btn_fanhui.png'),
),
),
)
],
),
),
Container(
width: w57,
height: w57,
margin: EdgeInsets.only(top: t18),
child: const ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(11)),
child: Image(
image: AssetImage('assets/images/ic_launcher.png'),
),
),
),
Container(
margin: EdgeInsets.only(top: t18),
child: Text(
"当前版本:$version",
style: const TextStyle(fontSize: 13, color: Color(0xFF868686)),
),
),
],
),
);
}
}