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.
191 lines
8.4 KiB
191 lines
8.4 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/mine/open_webview.dart';
|
|
import 'package:dating_touchme_app/pages/setting/charge_setting.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:flutter_smart_dialog/flutter_smart_dialog.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:permission_handler/permission_handler.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: '隐私设置', onClick: (cell) {
|
|
SmartDialog.showToast('功能暂未开放');
|
|
},),
|
|
TDCell(arrow: true, title: '支付设置', onClick: (cell) {
|
|
Get.to(() => ChargeSetting());
|
|
},),
|
|
TDCell(arrow: true, title: '青少年模式', onClick: (cell) {
|
|
Get.to(() => TeenagerModePage());
|
|
},),
|
|
],
|
|
),
|
|
const SizedBox(height: 12),
|
|
TDCellGroup(
|
|
theme: TDCellGroupTheme.cardTheme,
|
|
cells: [
|
|
TDCell(arrow: true, title: '系统权限管理', onClick: (cell) {
|
|
openAppSettings();
|
|
},),
|
|
TDCell(arrow: true, title: '消息通知', onClick: (cell) {
|
|
// Get.to(() => NoticePage());
|
|
|
|
openAppSettings();
|
|
}),
|
|
TDCell(arrow: true, title: '用户协议', onClick: (cell) {
|
|
// Get.to(() => NoticePage());
|
|
|
|
Get.to(() => OpenWebView(url: "https://www.quzhaoqin.com/privacy.html"));
|
|
}),
|
|
TDCell(arrow: true, title: '隐私政策', onClick: (cell) {
|
|
// Get.to(() => NoticePage());
|
|
|
|
Get.to(() => OpenWebView(url: "https://www.quzhaoqin.com/information.html"));
|
|
}),
|
|
TDCell(arrow: true, title: '检查更新', onClick: (cell) {
|
|
controller.checkVersion();
|
|
// SmartDialog.showToast('功能暂未开放');
|
|
},
|
|
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,
|
|
gradient: LinearGradient(
|
|
begin: Alignment.centerLeft, // 90deg: 从左到右
|
|
end: Alignment.centerRight,
|
|
colors: [
|
|
Color.fromRGBO(131, 89, 255, 1), // 起点颜色
|
|
Color.fromRGBO(77, 127, 231, 1), // 中间颜色
|
|
Color.fromRGBO(61, 138, 224, 1), // 终点颜色
|
|
],
|
|
stops: [0.0, 0.7753, 1.0], // 对应 0%、77.53%、100%
|
|
),
|
|
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());
|
|
},),
|
|
],
|
|
),
|
|
],
|
|
);
|
|
}),
|
|
),
|
|
);
|
|
}
|
|
|
|
}
|
|
|