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.
 
 
 
 
 

158 lines
6.5 KiB

import 'package:dating_touchme_app/controller/discover/discover_controller.dart';
import 'package:dating_touchme_app/controller/home/home_controller.dart';
import 'package:dating_touchme_app/controller/message/conversation_controller.dart';
import 'package:dating_touchme_app/controller/mine/mine_controller.dart';
import 'package:dating_touchme_app/pages/mine/login_page.dart';
import 'package:dating_touchme_app/pages/setting/deactivate_page.dart';
import 'package:dating_touchme_app/pages/setting/teenager_mode_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:tdesign_flutter/tdesign_flutter.dart';
import '../../components/page_appbar.dart';
import '../../controller/setting/setting_controller.dart';
import 'blacklist_page.dart';
import 'notice_page.dart';
class SettingPage extends StatelessWidget {
SettingPage({super.key});
final SettingController controller = Get.put(SettingController());
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color(0xffF5F5F5),
appBar: PageAppbar(title: "设置"),
body: SingleChildScrollView(
padding: EdgeInsetsGeometry.symmetric(vertical: 16.w),
child: Obx(() {
return Column(
children: [
TDCellGroup(
theme: TDCellGroupTheme.cardTheme,
cells: [
TDCell(
arrow: false,
title: '后台播放',
rightIconWidget: TDSwitch(
isOn: true,
trackOnColor: const Color.fromRGBO(117, 98, 249, 1),
onChanged: (bool e) {
return false;
},
)
),
TDCell(
arrow: false,
title: '语音/视频通话提示音',
rightIconWidget: TDSwitch(isOn: false,trackOnColor: const Color.fromRGBO(117, 98, 249, 1),onChanged: (bool e) {
return false;
})
),
],
),
const SizedBox(height: 12),
TDCellGroup(
theme: TDCellGroupTheme.cardTheme,
cells: [
TDCell(arrow: true, title: '黑名单', onClick: (cell) {
Get.to(() => BlacklistPage());
}),
TDCell(arrow: true, title: '隐私设置'),
TDCell(arrow: true, title: '青少年模式', onClick: (cell) {
Get.to(() => TeenagerModePage());
},),
],
),
const SizedBox(height: 12),
TDCellGroup(
theme: TDCellGroupTheme.cardTheme,
cells: [
TDCell(arrow: true, title: '系统权限管理'),
TDCell(arrow: true, title: '消息通知', onClick: (cell) {
Get.to(() => NoticePage());
}),
TDCell(arrow: true, title: '检查更新', onClick: (cell) {
// _showUpdateDialog();
controller.checkVersion();
},
noteWidget: Text('当前版本:${controller.version.value}',style: TextStyle(fontSize: 13.w,color: const Color.fromRGBO(117, 98, 249, 1))),
)
],
),
const SizedBox(height: 12),
TDCellGroup(
theme: TDCellGroupTheme.cardTheme,
cells: [
TDCell(arrow: true, title: '退出登录', onClick: (cell){
showGeneralDialog(
context: context,
pageBuilder: (BuildContext buildContext, Animation<
double> animation,
Animation<double> secondaryAnimation) {
return TDAlertDialog(
title: '是否退出当前账号?',
buttonWidget: Container(
padding: EdgeInsetsGeometry.only(top: 16.w,
right: 30.w,
left: 30.w,
bottom: 32.w),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
TDButton(
text: '取 消',
width: 120,
size: TDButtonSize.large,
type: TDButtonType.fill,
shape: TDButtonShape.round,
theme: TDButtonTheme.defaultTheme,
onTap: () {
Navigator.of(context).pop();
},
),
TDButton(
text: '确 定',
width: 120,
size: TDButtonSize.large,
type: TDButtonType.fill,
shape: TDButtonShape.round,
theme: TDButtonTheme.danger,
onTap: () {
controller.logout();
Get.offAll(() => LoginPage());
},
),
],
),
)
);
},
);
},),
TDCell(arrow: true, titleWidget: Text(
"账号注销",
style: TextStyle(
color: const Color.fromRGBO(248, 85, 66, 1),
fontSize: TDTheme.of(context).fontBodyLarge?.size ?? 16,
height: TDTheme.of(context).fontBodyLarge?.height ?? 24,
fontWeight: FontWeight.w400,
),
), onClick: (cell){
Get.to(() => DeactivatePage());
},),
],
),
],
);
}),
),
);
}
}