66 lines
1.9 KiB
Dart
66 lines
1.9 KiB
Dart
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/http/member.dart';
|
|
import 'package:pilipala/models/user/info.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 userInfoCache = GStorage.userInfo;
|
|
UserInfoData? userInfo;
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
userInfo = userInfoCache.get('userInfoCache');
|
|
userLogin = userInfo != null;
|
|
}
|
|
|
|
@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(title: const Text('隐私设置')),
|
|
body: Column(
|
|
children: [
|
|
ListTile(
|
|
onTap: () {
|
|
if (!userLogin) {
|
|
SmartDialog.showToast('登录后查看');
|
|
return;
|
|
}
|
|
Get.toNamed('/blackListPage');
|
|
},
|
|
dense: false,
|
|
title: Text('黑名单管理', style: titleStyle),
|
|
subtitle: Text('已拉黑用户', style: subTitleStyle),
|
|
),
|
|
ListTile(
|
|
onTap: () {
|
|
if (!userLogin) {
|
|
SmartDialog.showToast('请先登录');
|
|
}
|
|
MemberHttp.cookieToKey();
|
|
},
|
|
dense: false,
|
|
title: Text('刷新access_key', style: titleStyle),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|