mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
chore: clean up
opt: pages Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -97,17 +97,24 @@ class MainController extends GetxController {
|
||||
if ((shouldCheckPM.not && res.firstOrNull?['status'] == true) ||
|
||||
(shouldCheckPM && res.getOrNull(1)?['status'] == true)) {
|
||||
int index = shouldCheckPM.not ? 0 : 1;
|
||||
if (msgUnReadTypes.contains(MsgUnReadType.reply)) {
|
||||
count += (res[index]['data']['reply'] as int?) ?? 0;
|
||||
}
|
||||
if (msgUnReadTypes.contains(MsgUnReadType.at)) {
|
||||
count += (res[index]['data']['at'] as int?) ?? 0;
|
||||
}
|
||||
if (msgUnReadTypes.contains(MsgUnReadType.like)) {
|
||||
count += (res[index]['data']['like'] as int?) ?? 0;
|
||||
}
|
||||
if (msgUnReadTypes.contains(MsgUnReadType.sysMsg)) {
|
||||
count += (res[index]['data']['sys_msg'] as int?) ?? 0;
|
||||
dynamic data = res[index]['data'];
|
||||
for (final item in msgUnReadTypes) {
|
||||
switch (item) {
|
||||
case MsgUnReadType.pm:
|
||||
break;
|
||||
case MsgUnReadType.reply:
|
||||
count += (data['reply'] as int?) ?? 0;
|
||||
break;
|
||||
case MsgUnReadType.at:
|
||||
count += (data['at'] as int?) ?? 0;
|
||||
break;
|
||||
case MsgUnReadType.like:
|
||||
count += (data['like'] as int?) ?? 0;
|
||||
break;
|
||||
case MsgUnReadType.sysMsg:
|
||||
count += (data['sys_msg'] as int?) ?? 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
count = count == 0
|
||||
@@ -176,7 +183,7 @@ class MainController extends GetxController {
|
||||
|
||||
void setCount([int count = 0]) async {
|
||||
if (dynIndex == -1 || navigationBars[dynIndex]['count'] == count) return;
|
||||
navigationBars[dynIndex]['count'] = count; // 修改 count 属性为新的值
|
||||
navigationBars[dynIndex]['count'] = count;
|
||||
navigationBars.refresh();
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ class _MainAppState extends State<MainApp>
|
||||
late final _homeController = Get.put(HomeController());
|
||||
late final _dynamicController = Get.put(DynamicsController());
|
||||
|
||||
late int _lastSelectTime = 0; //上次点击时间
|
||||
late int _lastSelectTime = 0;
|
||||
late bool enableMYBar;
|
||||
late bool useSideBar;
|
||||
|
||||
@@ -192,7 +192,7 @@ class _MainAppState extends State<MainApp>
|
||||
value: SystemUiOverlayStyle(
|
||||
systemNavigationBarColor: Colors.transparent,
|
||||
systemNavigationBarIconBrightness:
|
||||
Theme.of(context).brightness.reverse, // 设置虚拟按键图标颜色
|
||||
Theme.of(context).brightness.reverse,
|
||||
),
|
||||
child: Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
@@ -412,11 +412,6 @@ class _MainAppState extends State<MainApp>
|
||||
? Text(count.toString())
|
||||
: null,
|
||||
padding: const EdgeInsets.fromLTRB(6, 0, 6, 0),
|
||||
// isLabelVisible:
|
||||
// _mainController.dynamicBadgeType != DynamicBadgeMode.hidden &&
|
||||
// count > 0,
|
||||
// backgroundColor: Theme.of(context).colorScheme.primary,
|
||||
// textColor: Theme.of(context).colorScheme.onInverseSurface,
|
||||
child: icon,
|
||||
)
|
||||
: icon;
|
||||
|
||||
Reference in New Issue
Block a user