feat: 黑名单查看、屏蔽黑名单用户推荐/最热 #22
This commit is contained in:
58
lib/pages/setting/privacy_setting.dart
Normal file
58
lib/pages/setting/privacy_setting.dart
Normal file
@ -0,0 +1,58 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:pilipala/utils/storage.dart';
|
||||
|
||||
class PrivacySetting extends StatefulWidget {
|
||||
const PrivacySetting({super.key});
|
||||
|
||||
@override
|
||||
State<PrivacySetting> createState() => _PrivacySettingState();
|
||||
}
|
||||
|
||||
class _PrivacySettingState extends State<PrivacySetting> {
|
||||
bool userLogin = false;
|
||||
Box user = GStrorage.user;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
userLogin = user.get(UserBoxKey.userLogin) ?? false;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
TextStyle titleStyle = Theme.of(context).textTheme.titleMedium!;
|
||||
TextStyle subTitleStyle = Theme.of(context)
|
||||
.textTheme
|
||||
.labelMedium!
|
||||
.copyWith(color: Theme.of(context).colorScheme.outline);
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: false,
|
||||
titleSpacing: 0,
|
||||
title: Text(
|
||||
'隐私设置',
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
ListTile(
|
||||
onTap: () {
|
||||
if (!userLogin) {
|
||||
SmartDialog.showToast('登录后查看');
|
||||
return;
|
||||
}
|
||||
Get.toNamed('/blackListPage');
|
||||
},
|
||||
dense: false,
|
||||
title: Text('黑名单管理', style: titleStyle),
|
||||
subtitle: Text('已拉黑用户', style: subTitleStyle),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -19,6 +19,11 @@ class SettingPage extends StatelessWidget {
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
ListTile(
|
||||
onTap: () => Get.toNamed('/privacySetting'),
|
||||
dense: false,
|
||||
title: const Text('隐私设置'),
|
||||
),
|
||||
ListTile(
|
||||
onTap: () => Get.toNamed('/playSetting'),
|
||||
dense: false,
|
||||
|
||||
Reference in New Issue
Block a user