You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

294 lines
8.8 KiB

3 years ago
import 'dart:io';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
3 years ago
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart';
4 years ago
import 'package:flutter_screenutil/flutter_screenutil.dart';
3 years ago
import 'package:huixiang/utils/bridge.dart';
3 years ago
import 'package:huixiang/utils/font_weight.dart';
4 years ago
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/update_dialog.dart';
4 years ago
import 'package:package_info/package_info.dart';
class AboutPage extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _AboutPage();
}
}
4 years ago
class _AboutPage extends State<AboutPage> {
String version = "1.0.0";
@override
void initState() {
super.initState();
PackageInfo.fromPlatform().then((PackageInfo packageInfo) {
version = packageInfo.version;
setState(() {});
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
4 years ago
appBar: MyAppBar(
title: S.of(context).guanyu,
titleColor: Colors.black,
background: Color(0xFFF7F7F7),
leadingColor: Colors.black,
),
4 years ago
body: Stack(
children: [
Container(
decoration: new BoxDecoration(
border: Border(
4 years ago
bottom: BorderSide(color: Color(0xffF7F7F7), width: 0.0)),
color: Color(0xffF7F7F7),
),
padding: EdgeInsets.only(top: 25.h),
alignment: Alignment.center,
3 years ago
child: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child:Column(
children: [
4 years ago
Image.asset(
"assets/image/icon_about_logo.webp",
3 years ago
width: 130,
height: 130,
4 years ago
),
Padding(
padding: EdgeInsets.only(top: 32.h, bottom: 5.h),
child: Text(
S.of(context).yixinhuixiang,
style: TextStyle(
fontSize: 30.sp,
color: Color(0xff32A060),
),
),
),
Text(
S.of(context).guojiankangyoujishenghuo,
style: TextStyle(
fontSize: 16.sp,
3 years ago
fontWeight: MyFontWeight.regular,
4 years ago
color: Color(0xffB2B2B2),
),
),
4 years ago
SizedBox(
4 years ago
height: 20.h,
4 years ago
),
settingItem(
S.of(context).dangqianbanben,
S.of(context).banben(version),
),
3 years ago
// textItem(S.of(context).tebieshengming),
3 years ago
InkWell(
onTap: () {
3 years ago
Navigator.of(context)
.pushNamed('/router/help_feedback_page');
// showAlertDialog(version);
},
3 years ago
child: textItem(S.of(context).shiyongbangzhu),
),
3 years ago
if (!Platform.isAndroid)
GestureDetector(
child: settingSingleItem(S.of(context).geiwopingfen),
onTap: () {
3 years ago
Bridge.toAppStore().then((value) {
if (Platform.isAndroid && value == "0") {
SmartDialog.showToast("手机没有安装应用市场app",
alignment: Alignment.center);
}
});
// showAlertDialog(version);
3 years ago
},
),
GestureDetector(
child: settingSingleItem(S.of(context).yinsishengming),
onTap: () {
3 years ago
Navigator.of(context).pushNamed('/router/treaty_page');
},
),
GestureDetector(
child: settingSingleItem("用户协议"),
onTap: () {
3 years ago
Navigator.of(context).pushNamed('/router/user_service_page');
},
),
4 years ago
Padding(
4 years ago
padding: EdgeInsets.only(left: 20.w, right: 20.w),
4 years ago
child: Divider(
4 years ago
height: 10.0.h,
4 years ago
indent: 0.0,
color: Colors.grey,
),
),
3 years ago
SizedBox(
height:100.h,
),
],
3 years ago
),)
),
Container(
margin: EdgeInsets.only(bottom: 23.h),
alignment: Alignment.bottomCenter,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
4 years ago
Text(
"Copyright©2021",
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Colors.black,
4 years ago
fontSize: 12.sp,
3 years ago
fontWeight: MyFontWeight.medium,
),
4 years ago
),
SizedBox(
4 years ago
height: 10.h,
4 years ago
),
Align(
alignment: Alignment.center,
4 years ago
child: Text(
"知理知己(武汉)文化科技有限公司\n版权所有",
overflow: TextOverflow.ellipsis,
maxLines: 2,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.black,
4 years ago
fontSize: 12.sp,
3 years ago
fontWeight: MyFontWeight.medium,
),
4 years ago
),
),
],
4 years ago
),
),
],
),
);
}
Widget settingSingleItem(right) {
return Container(
margin: EdgeInsets.fromLTRB(16, 0, 16, 0),
child: Column(
children: [
4 years ago
Divider(
4 years ago
height: 10.0.h,
4 years ago
indent: 0.0,
color: Colors.grey,
),
Padding(
4 years ago
padding: EdgeInsets.only(top: 15.h, bottom: 15.h),
4 years ago
child: Row(
children: [
Expanded(
child: Text(
right,
style: TextStyle(
4 years ago
fontSize: 16.sp,
4 years ago
color: Color(0xFF353535),
3 years ago
fontWeight: MyFontWeight.medium,
4 years ago
),
),
),
4 years ago
SizedBox(
4 years ago
width: 16.w,
4 years ago
),
Icon(
Icons.keyboard_arrow_right,
size: 24,
),
],
)),
],
),
);
}
Widget settingItem(left, right) {
return Container(
margin: EdgeInsets.fromLTRB(16, 0, 16, 0),
child: Column(
children: [
4 years ago
Divider(
4 years ago
height: 10.0.h,
4 years ago
indent: 0.0,
color: Colors.grey,
),
Padding(
4 years ago
padding: EdgeInsets.only(top: 15.h, bottom: 15.h),
4 years ago
child: Row(
children: [
Expanded(
child: Text(
left,
style: TextStyle(
3 years ago
fontWeight: MyFontWeight.medium,
4 years ago
fontSize: 16.sp,
4 years ago
color: Color(0xFF353535),
),
),
flex: 1,
),
4 years ago
Text(
right,
style: TextStyle(
4 years ago
fontSize: 16.sp,
3 years ago
fontWeight: MyFontWeight.regular,
4 years ago
color: Color(0xFF727272),
),
),
],
)),
],
),
);
}
Widget textItem(text) {
return Container(
width: double.infinity,
// padding: EdgeInsets.fromLTRB(20, 16, 20, 16),
4 years ago
margin: EdgeInsets.fromLTRB(16.w, 0.h, 16.w, 0.h),
4 years ago
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Divider(
4 years ago
height: 10.0.h,
4 years ago
indent: 0.0,
color: Colors.grey,
),
Padding(
4 years ago
padding: EdgeInsets.only(top: 15.h, bottom: 15.h),
4 years ago
child: Text(
text,
style: TextStyle(
3 years ago
fontWeight: MyFontWeight.medium,
4 years ago
fontSize: 16.sp,
4 years ago
color: Color(0xFF353535),
),
),
),
],
),
);
}
///app更新弹窗
showAlertDialog(version) {
//显示对话框
showDialog(
context: context,
builder: (BuildContext context) {
return UpdateDialog(version);
},
);
}
4 years ago
}