import 'package:dating_touchme_app/pages/mine/login_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, height: 60.h, title: '允许中间邀请弹窗', rightIconWidget: TDSwitch(isOn: false,trackOnColor: const Color.fromRGBO(117, 98, 249, 1),onChanged: (bool e) { return false; }) ), TDCell( arrow: false, height: 60.h, title: '后台播放', rightIconWidget: TDSwitch( isOn: true, trackOnColor: const Color.fromRGBO(117, 98, 249, 1), onChanged: (bool e) { return false; }, ) ), TDCell( arrow: false, height: 60.h, 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, height: 60.h, title: '安全中心', onClick: (cell) { print('安全中心'); }), TDCell(arrow: true, height: 60.h, title: '黑名单', onClick: (cell) { Get.to(() => BlacklistPage()); }), ], ), const SizedBox(height: 12), TDCellGroup( theme: TDCellGroupTheme.cardTheme, cells: [ TDCell(arrow: true, height: 60.h, title: '系统权限管理'), TDCell(arrow: true, height: 60.h, title: '消息通知', onClick: (cell) { Get.to(() => NoticePage()); }), TDCell(arrow: true, height: 60.h, 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: 64), TDButton( text: '退出登录', width: MediaQuery.of(context).size.width - 40, size: TDButtonSize.large, type: TDButtonType.fill, shape: TDButtonShape.round, theme: TDButtonTheme.danger, onTap: () { showGeneralDialog( context: context, pageBuilder: (BuildContext buildContext, Animation< double> animation, Animation 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()); }, ), ], ), ) ); }, ); }, ), const SizedBox(height: 24), ], ); }), ), ); } }