隐私设置

This commit is contained in:
2022-11-01 11:06:51 +08:00
parent 0b5d510766
commit ff612bcc56
4 changed files with 54 additions and 9 deletions

View File

@@ -1,20 +1,40 @@
import 'package:chat/configs/app_colors.dart';
import 'package:chat/services/auth_service.dart';
import 'package:chat/views/user/widgets/link_action_item.dart';
import 'package:flutter/material.dart';
import 'package:get/get_state_manager/get_state_manager.dart';
class UserSettingPrivacyPage extends StatefulWidget {
class UserSettingPrivacyPage extends StatelessWidget {
const UserSettingPrivacyPage({Key? key}) : super(key: key);
@override
_UserSettingPrivacyPageState createState() => _UserSettingPrivacyPageState();
}
class _UserSettingPrivacyPageState extends State<UserSettingPrivacyPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('隐私权限'),
),
body: Container(),
body: Column(
children: [
const Divider(
height: 0,
color: AppColors.border,
),
GetX<AuthService>(
builder: (_) {
return LinkActionItem(
title: '允许通过搜索添加我为好友',
trailing: Switch(
value: _.userInfo.value.privacy,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
onChanged: (e) {
_.togglePrivacy();
},
),
);
},
),
],
),
);
}
}