2 changed files with 234 additions and 0 deletions
Unified View
Diff Options
@ -0,0 +1,79 @@ |
|||||
|
import 'package:flutter/material.dart'; |
||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
|
import 'package:tdesign_flutter/tdesign_flutter.dart'; |
||||
|
|
||||
|
class NoticePage extends StatefulWidget { |
||||
|
const NoticePage({super.key}); |
||||
|
|
||||
|
@override |
||||
|
State<NoticePage> createState() => _NoticePageState(); |
||||
|
} |
||||
|
|
||||
|
class _NoticePageState extends State<NoticePage> with AutomaticKeepAliveClientMixin{ |
||||
|
|
||||
|
@override |
||||
|
Widget build(BuildContext context) { |
||||
|
super.build(context); |
||||
|
return Scaffold( |
||||
|
backgroundColor: Color(0xffF5F5F5), |
||||
|
appBar: AppBar( |
||||
|
title: Text('消息通知', style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold)), |
||||
|
centerTitle: true, |
||||
|
backgroundColor: Colors.white, |
||||
|
), |
||||
|
body: Expanded( |
||||
|
child: SingleChildScrollView( |
||||
|
padding: EdgeInsetsGeometry.symmetric(vertical: 16.w), |
||||
|
child: Column( |
||||
|
children: [ |
||||
|
TDCellGroup( |
||||
|
theme: TDCellGroupTheme.cardTheme, |
||||
|
cells: [ |
||||
|
TDCell( |
||||
|
arrow: true, |
||||
|
title: '接受推送通知', |
||||
|
description: '已开启', |
||||
|
), |
||||
|
TDCell( |
||||
|
arrow: false, |
||||
|
title: '接受推送通知', |
||||
|
description: '一段很长很长的内容文字', |
||||
|
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: false, |
||||
|
title: '后台播放', |
||||
|
description: '一段很长很长的内容文字', |
||||
|
rightIconWidget: TDSwitch( |
||||
|
isOn: true, |
||||
|
trackOnColor: const Color.fromRGBO(117, 98, 249, 1), |
||||
|
onChanged: (bool e){ |
||||
|
return false; |
||||
|
}, |
||||
|
) |
||||
|
), |
||||
|
], |
||||
|
), |
||||
|
], |
||||
|
), |
||||
|
), |
||||
|
), |
||||
|
); |
||||
|
} |
||||
|
|
||||
|
@override |
||||
|
bool get wantKeepAlive => true; |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,155 @@ |
|||||
|
import 'package:dating_touchme_app/components/home_appbar.dart'; |
||||
|
import 'package:dating_touchme_app/generated/assets.dart'; |
||||
|
import 'package:dating_touchme_app/pages/discover/live_room_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 'notice_page.dart'; |
||||
|
|
||||
|
class SettingPage extends StatefulWidget { |
||||
|
const SettingPage({super.key}); |
||||
|
|
||||
|
@override |
||||
|
State<SettingPage> createState() => _SettingPageState(); |
||||
|
} |
||||
|
|
||||
|
class _SettingPageState extends State<SettingPage> with AutomaticKeepAliveClientMixin{ |
||||
|
|
||||
|
@override |
||||
|
Widget build(BuildContext context) { |
||||
|
super.build(context); |
||||
|
return Scaffold( |
||||
|
backgroundColor: Color(0xffF5F5F5), |
||||
|
appBar: AppBar( |
||||
|
title: Text('设置', style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold)), |
||||
|
centerTitle: true, |
||||
|
backgroundColor: Colors.white, |
||||
|
), |
||||
|
body: Expanded( |
||||
|
child: SingleChildScrollView( |
||||
|
padding: EdgeInsetsGeometry.symmetric(vertical: 16.w), |
||||
|
child: Column( |
||||
|
children: [ |
||||
|
TDCellGroup( |
||||
|
theme: TDCellGroupTheme.cardTheme, |
||||
|
cells: [ |
||||
|
TDCell( |
||||
|
arrow: false, |
||||
|
title: '允许中间邀请弹窗', |
||||
|
rightIconWidget: TDSwitch( |
||||
|
isOn: false, |
||||
|
trackOnColor: const Color.fromRGBO(117, 98, 249, 1), |
||||
|
onChanged: (bool e){ |
||||
|
return false; |
||||
|
}, |
||||
|
) |
||||
|
), |
||||
|
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: '单行标题'), |
||||
|
], |
||||
|
), |
||||
|
const SizedBox(height: 12), |
||||
|
TDCellGroup( |
||||
|
theme: TDCellGroupTheme.cardTheme, |
||||
|
cells: [ |
||||
|
TDCell(arrow: true, title: '黑名单',onClick: (cell) { |
||||
|
print('单行标题'); |
||||
|
} |
||||
|
), |
||||
|
], |
||||
|
), |
||||
|
const SizedBox(height: 12), |
||||
|
TDCellGroup( |
||||
|
theme: TDCellGroupTheme.cardTheme, |
||||
|
cells: [ |
||||
|
TDCell(arrow: true, title: '单行标题'), |
||||
|
TDCell(arrow: true, title: '单行标题'), |
||||
|
TDCell(arrow: true, title: '消息通知',onClick: (cell) { |
||||
|
Get.to(()=> NoticePage()); |
||||
|
} |
||||
|
), |
||||
|
], |
||||
|
), |
||||
|
const SizedBox(height: 36), |
||||
|
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<double> secondaryAnimation) { |
||||
|
// return TDConfirmDialog( |
||||
|
// title: '是否退出当前账号?', |
||||
|
// |
||||
|
// ); |
||||
|
// }, |
||||
|
// ); |
||||
|
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: (){ |
||||
|
Navigator.of(context).pop(); |
||||
|
}, |
||||
|
), |
||||
|
], |
||||
|
), |
||||
|
) |
||||
|
); |
||||
|
}, |
||||
|
); |
||||
|
}, |
||||
|
), |
||||
|
], |
||||
|
), |
||||
|
), |
||||
|
), |
||||
|
); |
||||
|
} |
||||
|
|
||||
|
@override |
||||
|
bool get wantKeepAlive => true; |
||||
|
} |
||||
|
|
||||
Write
Preview
Loading…
Cancel
Save