Files
zh-chat-flutter/lib/views/user/setting/privacy/index_page.dart
2022-11-01 11:06:51 +08:00

41 lines
1.1 KiB
Dart

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 StatelessWidget {
const UserSettingPrivacyPage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('隐私权限'),
),
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();
},
),
);
},
),
],
),
);
}
}