268 lines
10 KiB
Dart
268 lines
10 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:game/network/NetworkConfig.dart';
|
|
import 'package:shared_preferences/shared_preferences.dart';
|
|
|
|
import 'agreement_page.dart';
|
|
|
|
class SettingPage extends StatefulWidget {
|
|
const SettingPage({super.key});
|
|
|
|
@override
|
|
State<SettingPage> createState() => _SettingPageState();
|
|
}
|
|
|
|
class _SettingPageState extends State<SettingPage> {
|
|
@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 h60 = size.width / 6;
|
|
final t18 = size.width / 20;
|
|
final l15 = size.width / 24;
|
|
final l23 = size.width / 15.65217391304348;
|
|
final s14 = size.width / 25.714285714285;
|
|
final s11 = size.width / 32.727272727272;
|
|
final w4 = size.width / 90;
|
|
final h8 = size.width / 45;
|
|
|
|
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: const Color(0xFFD6D6D7)),
|
|
),
|
|
Positioned(
|
|
left: l14,
|
|
child: GestureDetector(
|
|
onTap: () {
|
|
Navigator.pop(context);
|
|
},
|
|
child: Image(
|
|
width: w19,
|
|
height: h26,
|
|
image: const AssetImage('assets/images/btn_fanhui.png'),
|
|
),
|
|
),
|
|
)
|
|
],
|
|
),
|
|
),
|
|
Expanded(
|
|
child: SingleChildScrollView(
|
|
child: Column(
|
|
children: [
|
|
///用户协议
|
|
GestureDetector(
|
|
onTap: () {
|
|
Navigator.push(
|
|
context,
|
|
MaterialPageRoute(
|
|
builder: (context) => AgreementPage(
|
|
title: "用户协议",
|
|
url: "${NetworkConfig.configBean?.userAgreement}",
|
|
)),
|
|
);
|
|
},
|
|
child: Container(
|
|
height: h60,
|
|
margin: EdgeInsets.only(top: t18, left: l15, right: l15),
|
|
decoration: BoxDecoration(
|
|
color: Color(0xFF202530),
|
|
borderRadius: BorderRadius.all(Radius.circular(s11)),
|
|
),
|
|
child: Row(
|
|
children: [
|
|
Container(
|
|
margin: EdgeInsets.only(left: l14),
|
|
child: Text(
|
|
"用户协议",
|
|
style: TextStyle(fontSize: s14, color: Color(0xFFD6D6D7)),
|
|
),
|
|
),
|
|
Expanded(child: Container()),
|
|
Container(
|
|
margin: EdgeInsets.only(right: l23),
|
|
child: Image(
|
|
width: w4,
|
|
height: h8,
|
|
image: AssetImage('assets/images/ic_arrow.png'),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
|
|
///隐私政策
|
|
GestureDetector(
|
|
onTap: () {
|
|
Navigator.push(
|
|
context,
|
|
MaterialPageRoute(
|
|
builder: (context) => AgreementPage(
|
|
title: "隐私政策",
|
|
url: "${NetworkConfig.configBean?.privacyAgreement}",
|
|
)),
|
|
);
|
|
},
|
|
child: Container(
|
|
height: h60,
|
|
margin: EdgeInsets.only(top: t18, left: l15, right: l15),
|
|
decoration: BoxDecoration(
|
|
color: Color(0xFF202530),
|
|
borderRadius: BorderRadius.all(Radius.circular(s11)),
|
|
),
|
|
child: Row(
|
|
children: [
|
|
Container(
|
|
margin: EdgeInsets.only(left: l14),
|
|
child: Text(
|
|
"隐私政策",
|
|
style: TextStyle(fontSize: s14, color: Color(0xFFD6D6D7)),
|
|
),
|
|
),
|
|
Expanded(child: Container()),
|
|
Container(
|
|
margin: EdgeInsets.only(right: l23),
|
|
child: Image(
|
|
width: w4,
|
|
height: h8,
|
|
image: AssetImage('assets/images/ic_arrow.png'),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
|
|
///实名认证
|
|
GestureDetector(
|
|
onTap: () {
|
|
Navigator.pushNamed(context, "/RealNamePage");
|
|
},
|
|
child: Container(
|
|
height: h60,
|
|
margin: EdgeInsets.only(top: t18, left: l15, right: l15),
|
|
decoration: BoxDecoration(
|
|
color: Color(0xFF202530),
|
|
borderRadius: BorderRadius.all(Radius.circular(s11)),
|
|
),
|
|
child: Row(
|
|
children: [
|
|
Container(
|
|
margin: EdgeInsets.only(left: l14),
|
|
child: Text(
|
|
"实名认证",
|
|
style: TextStyle(fontSize: s14, color: Color(0xFFD6D6D7)),
|
|
),
|
|
),
|
|
Expanded(child: Container()),
|
|
Container(
|
|
margin: EdgeInsets.only(right: l23),
|
|
child: Image(
|
|
width: w4,
|
|
height: h8,
|
|
image: AssetImage('assets/images/ic_arrow.png'),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
|
|
///退出登录
|
|
GestureDetector(
|
|
onTap: () async {
|
|
// Navigator.pushNamed(context, "/AboutPage");
|
|
NetworkConfig.token = "";
|
|
final SharedPreferences prefs = await SharedPreferences.getInstance();
|
|
await prefs.setString('token', "");
|
|
Navigator.pushReplacementNamed(context, "/HomePage");
|
|
},
|
|
child: Container(
|
|
height: h60,
|
|
margin: EdgeInsets.only(top: t18, left: l15, right: l15),
|
|
decoration: BoxDecoration(
|
|
color: Color(0xFF202530),
|
|
borderRadius: BorderRadius.all(Radius.circular(s11)),
|
|
),
|
|
child: Row(
|
|
children: [
|
|
Container(
|
|
margin: EdgeInsets.only(left: l14),
|
|
child: Text(
|
|
"退出登录",
|
|
style: TextStyle(fontSize: s14, color: Color(0xFFD6D6D7)),
|
|
),
|
|
),
|
|
Expanded(child: Container()),
|
|
Container(
|
|
margin: EdgeInsets.only(right: l23),
|
|
child: Image(
|
|
width: w4,
|
|
height: h8,
|
|
image: AssetImage('assets/images/ic_arrow.png'),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
|
|
///关于
|
|
GestureDetector(
|
|
onTap: () {
|
|
Navigator.pushNamed(context, "/AboutPage");
|
|
},
|
|
child: Container(
|
|
height: h60,
|
|
margin: EdgeInsets.only(top: t18, left: l15, right: l15),
|
|
decoration: BoxDecoration(
|
|
color: Color(0xFF202530),
|
|
borderRadius: BorderRadius.all(Radius.circular(s11)),
|
|
),
|
|
child: Row(
|
|
children: [
|
|
Container(
|
|
margin: EdgeInsets.only(left: l14),
|
|
child: Text(
|
|
"关于",
|
|
style: TextStyle(fontSize: s14, color: Color(0xFFD6D6D7)),
|
|
),
|
|
),
|
|
Expanded(child: Container()),
|
|
Container(
|
|
margin: EdgeInsets.only(right: l23),
|
|
child: Image(
|
|
width: w4,
|
|
height: h8,
|
|
image: AssetImage('assets/images/ic_arrow.png'),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|