import 'dart:io';
|
import 'dart:ui';
|
|
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/material.dart';
|
import '../../ui/common/browser.dart';
|
import '../../utils/config_util.dart';
|
import '../../utils/share_preference.dart';
|
import '../../utils/string_util.dart';
|
import '../../utils/ui_constant.dart';
|
import '../../ui/widget/nav.dart';
|
import '../../utils/pageutils.dart';
|
|
import 'advice_submit.dart';
|
import 'package:launch_review/launch_review.dart';
|
import 'package:package_info/package_info.dart';
|
|
class AboutUsPage extends StatefulWidget {
|
AboutUsPage({Key? key, required this.title}) : super(key: key);
|
|
// This widget is the home page of your application. It is stateful, meaning
|
// that it has a State object (defined below) that contains fields that affect
|
// how it looks.
|
|
// This class is the configuration for the state. It holds the values (in this
|
// case the title) provided by the parent (in this case the App widget) and
|
// used by the build method of the State. Fields in a Widget subclass are
|
// always marked "final".
|
|
final String title;
|
|
@override
|
_AboutUsPageState createState() => _AboutUsPageState();
|
}
|
|
class _AboutUsPageState extends State<AboutUsPage>
|
with SingleTickerProviderStateMixin {
|
String versionName = "";
|
|
@override
|
void initState() {
|
super.initState();
|
PackageInfo.fromPlatform().then((PackageInfo packageInfo) {
|
setState(() {
|
versionName = packageInfo.version;
|
});
|
});
|
}
|
|
BoxDecoration getItemDecoration(Color bgColor, Color shadowColor) {
|
return BoxDecoration(
|
borderRadius: const BorderRadius.all(Radius.elliptical(10, 10)),
|
color: bgColor,
|
boxShadow: [
|
BoxShadow(
|
color: shadowColor,
|
blurRadius: 2.0,
|
offset: const Offset(0.0, 5.0), //阴影y轴偏移量
|
spreadRadius: 1 //阴影扩散程度
|
)
|
]);
|
}
|
|
@override
|
Widget build(BuildContext context) {
|
return Scaffold(
|
backgroundColor: Color(0xFFFFFFFF),
|
body: Container(
|
child: Flex(
|
direction: Axis.vertical,
|
children: [
|
TopNavBar(title: "关于我们"),
|
const SizedBox(
|
height: 50,
|
),
|
Column(
|
crossAxisAlignment: CrossAxisAlignment.center,
|
mainAxisSize: MainAxisSize.min,
|
children: [
|
ClipRRect(
|
borderRadius: BorderRadius.circular(12),
|
child: Image.asset(
|
"assets/imgs/icon.png",
|
height: 82,
|
),
|
),
|
const SizedBox(
|
height: 17,
|
),
|
Text(
|
"版本号:$versionName",
|
style:
|
const TextStyle(fontSize: 13, color: Color(0xFF999999)),
|
)
|
],
|
),
|
const SizedBox(
|
height: 80,
|
),
|
getItemView(
|
title: "用户协议",
|
onTap: () {
|
NavigatorUtil.navigateToNextPage(
|
context,
|
BrowserPage(title: "用户协议", url: Constant.PROTOCOL_URL),
|
(data) {});
|
}),
|
getItemView(
|
title: "联系我们",
|
onTap: () {
|
MySharedPreferences.getInstance()
|
.getString("contactUsLink")
|
.then((value) {
|
if (StringUtil.isNullOrEmpty(value)) {
|
return;
|
}
|
|
NavigatorUtil.navigateToNextPage(context,
|
BrowserPage(title: "联系我们", url: value!), (data) {});
|
});
|
}),
|
getItemView(
|
title: "注销账户",
|
onTap: () {
|
MySharedPreferences.getInstance()
|
.getString("unRegisterLink")
|
.then((value) {
|
if (!StringUtil.isNullOrEmpty(value)) {
|
NavigatorUtil.navigateToNextPage(context,
|
BrowserPage(title: "账户注销", url: value!), (data) {});
|
}
|
});
|
}),
|
],
|
),
|
));
|
}
|
|
Widget getItemView(
|
{required String title, required GestureTapCallback onTap}) {
|
return InkWell(
|
onTap: () {
|
onTap();
|
},
|
child: Container(
|
height: 40,
|
padding: const EdgeInsets.fromLTRB(25, 0, 25, 0),
|
margin: const EdgeInsets.fromLTRB(10, 0, 10, 0),
|
child: Row(
|
crossAxisAlignment: CrossAxisAlignment.center,
|
children: [
|
Text(
|
title,
|
style: TextStyle(fontSize: 15, color: const Color(0xFF00A8FF)),
|
),
|
Expanded(child: Container()),
|
const Icon(
|
Icons.chevron_right,
|
color: Color(0xFF00A8FF),
|
)
|
],
|
),
|
),
|
);
|
}
|
}
|