Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-07-23 16:47:11 +08:00
parent 148e0872b4
commit 418a1e8d39
821 changed files with 29467 additions and 25520 deletions

View File

@@ -23,9 +23,10 @@ class MineController extends GetxController {
AccountService accountService = Get.find<AccountService>();
Rx<ThemeType> themeType = ThemeType.system.obs;
static RxBool anonymity = (Accounts.account.isNotEmpty &&
!Accounts.get(AccountType.heartbeat).isLogin)
.obs;
static RxBool anonymity =
(Accounts.account.isNotEmpty &&
!Accounts.get(AccountType.heartbeat).isLogin)
.obs;
ThemeType get nextThemeType =>
ThemeType.values[(themeType.value.index + 1) % ThemeType.values.length];
@@ -42,8 +43,10 @@ class MineController extends GetxController {
if (!accountService.isLogin.value || longPress) {
Get.toNamed('/loginPage', preventDuplicates: false);
} else {
Get.toNamed('/member?mid=${userInfo.value.mid}',
preventDuplicates: false);
Get.toNamed(
'/member?mid=${userInfo.value.mid}',
preventDuplicates: false,
);
}
}
@@ -99,8 +102,9 @@ class MineController extends GetxController {
alignment: Alignment.bottomCenter,
builder: (context) {
final theme = Theme.of(context);
final style =
TextStyle(color: theme.colorScheme.onSecondaryContainer);
final style = TextStyle(
color: theme.colorScheme.onSecondaryContainer,
);
return ColoredBox(
color: theme.colorScheme.secondaryContainer,
child: Padding(
@@ -118,7 +122,7 @@ class MineController extends GetxController {
children: <Widget>[
const Icon(MdiIcons.incognito, size: 20),
const SizedBox(width: 10),
Text('已进入无痕模式', style: theme.textTheme.titleMedium)
Text('已进入无痕模式', style: theme.textTheme.titleMedium),
],
),
const SizedBox(height: 10),
@@ -226,7 +230,9 @@ class MineController extends GetxController {
SmartDialog.showToast('账号未登录');
return;
}
Get.toNamed('/memberDynamics?mid=${userInfo.value.mid}',
preventDuplicates: false);
Get.toNamed(
'/memberDynamics?mid=${userInfo.value.mid}',
preventDuplicates: false,
);
}
}

View File

@@ -20,65 +20,65 @@ class _MinePageState extends State<MinePage> {
..queryUserInfo();
Widget _header(ThemeData theme) => Row(
children: [
const SizedBox(width: 12),
Image.asset(
'assets/images/logo/logo.png',
width: 35,
),
const SizedBox(width: 5),
Text(
'PiliPlus',
style: theme.textTheme.titleMedium,
),
const Spacer(),
Obx(
() {
final anonymity = MineController.anonymity.value;
return IconButton(
iconSize: 40.0,
padding: const EdgeInsets.all(8),
style: const ButtonStyle(
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
),
tooltip: "${anonymity ? '退出' : '进入'}无痕模式",
onPressed: MineController.onChangeAnonymity,
icon: anonymity
? const Icon(MdiIcons.incognito, size: 24)
: const Icon(MdiIcons.incognitoOff, size: 24),
);
},
),
Obx(
() {
return IconButton(
iconSize: 40.0,
padding: const EdgeInsets.all(8),
style: const ButtonStyle(
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
),
tooltip: '切换至${_mineController.nextThemeType.desc}主题',
onPressed: _mineController.onChangeTheme,
icon: _mineController.themeType.value.icon,
);
},
),
IconButton(
children: [
const SizedBox(width: 12),
Image.asset(
'assets/images/logo/logo.png',
width: 35,
),
const SizedBox(width: 5),
Text(
'PiliPlus',
style: theme.textTheme.titleMedium,
),
const Spacer(),
Obx(
() {
final anonymity = MineController.anonymity.value;
return IconButton(
iconSize: 40.0,
padding: const EdgeInsets.all(8),
style: const ButtonStyle(
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
),
tooltip: '设置',
onPressed: () => {
Get.back(),
Get.toNamed('/setting', preventDuplicates: false),
},
icon: const Icon(MdiIcons.cogs, size: 24),
),
const SizedBox(width: 10),
],
);
tooltip: "${anonymity ? '退出' : '进入'}无痕模式",
onPressed: MineController.onChangeAnonymity,
icon: anonymity
? const Icon(MdiIcons.incognito, size: 24)
: const Icon(MdiIcons.incognitoOff, size: 24),
);
},
),
Obx(
() {
return IconButton(
iconSize: 40.0,
padding: const EdgeInsets.all(8),
style: const ButtonStyle(
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
),
tooltip: '切换至${_mineController.nextThemeType.desc}主题',
onPressed: _mineController.onChangeTheme,
icon: _mineController.themeType.value.icon,
);
},
),
IconButton(
iconSize: 40.0,
padding: const EdgeInsets.all(8),
style: const ButtonStyle(
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
),
tooltip: '设置',
onPressed: () => {
Get.back(),
Get.toNamed('/setting', preventDuplicates: false),
},
icon: const Icon(MdiIcons.cogs, size: 24),
),
const SizedBox(width: 10),
],
);
@override
Widget build(BuildContext context) {
@@ -174,7 +174,11 @@ class _MinePageState extends State<MinePage> {
),
),
Image.asset(
'assets/images/lv/lv${levelInfo == null ? 0 : userInfo.isSeniorMember == 1 ? '6_s' : levelInfo.currentLevel}.png',
'assets/images/lv/lv${levelInfo == null
? 0
: userInfo.isSeniorMember == 1
? '6_s'
: levelInfo.currentLevel}.png',
height: 10,
),
],
@@ -242,7 +246,8 @@ class _MinePageState extends State<MinePage> {
: 0,
backgroundColor: theme.colorScheme.inversePrimary,
valueColor: AlwaysStoppedAnimation<Color>(
theme.colorScheme.primary),
theme.colorScheme.primary,
),
),
],
),