87 lines
2.3 KiB
Dart
87 lines
2.3 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;
|
|
return Scaffold(
|
|
backgroundColor: const Color(0xFF17181A),
|
|
body: Column(
|
|
children: [
|
|
Container(
|
|
width: size.width,
|
|
height: 50,
|
|
margin: EdgeInsets.only(top: MediaQuery.of(context).padding.top),
|
|
child: Stack(
|
|
alignment: Alignment.center,
|
|
children: [
|
|
Text(
|
|
"关于我们",
|
|
style: TextStyle(fontSize: 16, color: Color(0xFFD6D6D7)),
|
|
),
|
|
Positioned(
|
|
left: 14,
|
|
child: GestureDetector(
|
|
onTap: () {
|
|
Navigator.pop(context);
|
|
},
|
|
child: Image(
|
|
width: 19,
|
|
height: 26,
|
|
image: AssetImage('assets/images/btn_fanhui.png'),
|
|
),
|
|
),
|
|
)
|
|
],
|
|
),
|
|
),
|
|
Container(
|
|
width: 57,
|
|
height: 57,
|
|
margin: EdgeInsets.only(top: 18),
|
|
child: ClipRRect(
|
|
borderRadius: BorderRadius.all(Radius.circular(11)),
|
|
child: Image(
|
|
image: AssetImage('assets/images/ic_launcher.png'),
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
margin: EdgeInsets.only(top: 18),
|
|
child: Text(
|
|
"当前版本:$version",
|
|
style: TextStyle(fontSize: 13, color: Color(0xFF868686)),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|