3840b7fe
liangchengyou
feat:更新设置页面
|
1
|
import 'package:flutter/material.dart';
|
c5ed9934
xiaoyu
为清除缓存添加提示
|
2
|
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
3840b7fe
liangchengyou
feat:更新设置页面
|
3
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
d5fb5080
biao
设置页添加版本号 ,播放音频冗余代码删除
|
4
|
import 'package:package_info_plus/package_info_plus.dart';
|
3840b7fe
liangchengyou
feat:更新设置页面
|
5
|
import 'package:wow_english/common/widgets/we_app_bar.dart';
|
c5ed9934
xiaoyu
为清除缓存添加提示
|
6
|
import 'package:wow_english/utils/toast_util.dart';
|
3840b7fe
liangchengyou
feat:更新设置页面
|
7
8
9
10
11
12
13
14
|
import '../../../route/route.dart';
class SettingPage extends StatefulWidget {
const SettingPage({super.key});
@override
State<StatefulWidget> createState() {
|
d5fb5080
biao
设置页添加版本号 ,播放音频冗余代码删除
|
15
|
return SettingPageState();
|
3840b7fe
liangchengyou
feat:更新设置页面
|
16
17
18
19
|
}
}
class SettingPageState extends State<SettingPage> {
|
d5fb5080
biao
设置页添加版本号 ,播放音频冗余代码删除
|
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
String? _version;
String? _buildNum;
@override
void initState() {
super.initState();
_retrieveVersionInfo();
}
Future<void> _retrieveVersionInfo() async {
PackageInfo packageInfo = await PackageInfo.fromPlatform();
setState(() {
_version = packageInfo.version;
_buildNum = packageInfo.buildNumber;
});
}
|
3840b7fe
liangchengyou
feat:更新设置页面
|
36
37
|
@override
Widget build(BuildContext context) {
|
d5fb5080
biao
设置页添加版本号 ,播放音频冗余代码删除
|
38
|
return Scaffold(
|
3840b7fe
liangchengyou
feat:更新设置页面
|
39
40
41
42
43
44
45
46
47
48
49
|
appBar: const WEAppBar(
titleText: '设置',
),
body: Container(
color: Colors.white,
padding: EdgeInsets.only(left: 17.w, right: 17.w),
child: SafeArea(
child: Center(
child: ListView(
children: [
34.verticalSpace,
|
d5fb5080
biao
设置页添加版本号 ,播放音频冗余代码删除
|
50
|
_buildItemWidget('注销账号', onPress: () {
|
3840b7fe
liangchengyou
feat:更新设置页面
|
51
52
53
|
pushNamed(AppRouteName.deleteAccount);
}),
12.verticalSpace,
|
c5ed9934
xiaoyu
为清除缓存添加提示
|
54
55
56
57
58
59
60
|
_buildItemWidget('清除缓存', onPress: () {
EasyLoading.show();
Future.delayed(const Duration(seconds: 1), (){
showToast("清除成功");
EasyLoading.dismiss();
});
}),
|
3840b7fe
liangchengyou
feat:更新设置页面
|
61
|
12.verticalSpace,
|
d5fb5080
biao
设置页添加版本号 ,播放音频冗余代码删除
|
62
|
_buildItemWidget('帮助与反馈', onPress: () {
|
3840b7fe
liangchengyou
feat:更新设置页面
|
63
64
|
pushNamed(AppRouteName.reBack);
}),
|
d5fb5080
biao
设置页添加版本号 ,播放音频冗余代码删除
|
65
66
67
|
12.verticalSpace,
_buildItemWidget('Version: $_version Build:$_buildNum',
onPress: () {}),
|
3840b7fe
liangchengyou
feat:更新设置页面
|
68
69
70
71
72
73
74
|
],
),
),
),
),
);
}
|
d5fb5080
biao
设置页添加版本号 ,播放音频冗余代码删除
|
75
76
|
Widget _buildItemWidget(String text, {VoidCallback? onPress}) {
|
3840b7fe
liangchengyou
feat:更新设置页面
|
77
78
79
|
return OutlinedButton(
onPressed: () => onPress?.call(),
style: ButtonStyle(
|
d5fb5080
biao
设置页添加版本号 ,播放音频冗余代码删除
|
80
81
82
83
|
side: MaterialStateProperty.all(
BorderSide(color: const Color(0xFF140C10), width: 1.5.w)),
shape: MaterialStateProperty.all(
RoundedRectangleBorder(borderRadius: BorderRadius.circular(15.r))),
|
3840b7fe
liangchengyou
feat:更新设置页面
|
84
85
86
87
88
89
90
91
92
93
94
95
96
|
minimumSize: MaterialStateProperty.all(Size(double.infinity, 58.h)),
backgroundColor: MaterialStateProperty.all(Colors.white),
),
child: Text(
text,
style: TextStyle(
//fontWeight: FontWeight.w600,
color: const Color(0xFF333333),
fontSize: 21.sp,
),
),
);
}
|
d5fb5080
biao
设置页添加版本号 ,播放音频冗余代码删除
|
97
|
}
|