mobile_skt/lib/screens/mine/settings/mine_settings.dart

114 lines
4.4 KiB
Dart
Raw Normal View History

2024-10-16 09:48:17 +08:00
import 'package:flutter/material.dart';
import 'package:sk_base_mobile/app_theme.dart';
import 'package:sk_base_mobile/constants/bg_color.dart';
import 'package:sk_base_mobile/services/app_info.service.dart';
import 'package:sk_base_mobile/store/auth.store.dart';
import 'package:sk_base_mobile/util/screen_adaper_util.dart';
class MineSettingsPage extends StatelessWidget {
const MineSettingsPage({super.key});
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.symmetric(horizontal: ScreenAdaper.width(15)),
child: SingleChildScrollView(
child: Column(
children: [
Container(
decoration: BoxDecoration(
border: Border.all(),
borderRadius: BorderRadius.circular(15),
color: AppTheme.nearlyWhite),
width: ScreenAdaper.width(600),
padding:
EdgeInsets.symmetric(vertical: ScreenAdaper.width(10)),
child: InkWell(
onTap: () async {
await AuthStore.to.logout(force: true);
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: ScreenAdaper.width(20),
vertical: ScreenAdaper.width(20)),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Text(
'退出登录',
style: TextStyle(
fontSize: ScreenAdaper.height(30),
fontWeight: FontWeight.w600),
),
],
)))),
SizedBox(
height: ScreenAdaper.height(defaultPadding),
),
Container(
decoration: BoxDecoration(
border: Border.all(),
borderRadius: BorderRadius.circular(15),
color: AppTheme.nearlyWhite),
width: ScreenAdaper.width(600),
padding:
EdgeInsets.symmetric(vertical: ScreenAdaper.width(10)),
child: InkWell(
onTap: () async {
await AppInfoService.to.checkVersion(forceCheck: true);
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: ScreenAdaper.width(20),
vertical: ScreenAdaper.width(20)),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Text(
'v${AppInfoService.to.versionNumber}',
style: TextStyle(
fontSize: ScreenAdaper.height(25),
fontWeight: FontWeight.w400),
),
const Spacer(),
Text(
'检查更新',
style: TextStyle(
fontSize: ScreenAdaper.height(30),
fontWeight: FontWeight.w600),
),
],
))))
],
),
));
}
// Widget _buildSettingsItem(int index) {
// switch (index) {
// // auto translate
// case 0:
// return;
// case 1:
// return InkWell(
// onTap: () async {
// await AuthStore.to.deleteAccount();
// },
// child: Container(
// padding: EdgeInsets.symmetric(vertical: ScreenAdaper.width(10)),
// child: Row(
// children: [
// Text(
// 'Delete acount',
// style: TextStyle(fontSize: ScreenAdaper.height(18)),
// ),
// ],
// )));
// case 2:
// return I;
// default:
// return SizedBox();
// }
// }
}