Reapply "opt: msg badge"

This reverts commit f9c365011b.
This commit is contained in:
bggRGjQaUbCoE
2025-01-09 12:34:50 +08:00
parent 7e400701df
commit 41dfab371e
2 changed files with 54 additions and 105 deletions

View File

@@ -434,44 +434,7 @@ class _MainAppState extends State<MainApp>
const SizedBox(height: 8),
Obx(
() => _homeController.isLogin.value
? Stack(
clipBehavior: Clip.none,
alignment: Alignment.center,
children: [
IconButton(
tooltip: '消息',
onPressed: () {
Get.toNamed('/whisper');
_mainController.msgUnReadCount.value = '';
},
icon: const Icon(
Icons.notifications_none,
),
),
if (_mainController.msgBadgeMode !=
DynamicBadgeMode.hidden &&
_mainController.msgUnReadCount.value.isNotEmpty)
Positioned(
top: _mainController.msgBadgeMode ==
DynamicBadgeMode.number
? 8
: 12,
left: _mainController.msgBadgeMode ==
DynamicBadgeMode.number
? 22
: 32,
child: IgnorePointer(
child: Badge(
label: _mainController.msgBadgeMode ==
DynamicBadgeMode.number
? Text(_mainController.msgUnReadCount.value
.toString())
: null,
),
),
),
],
)
? msgBadge(_mainController)
: const SizedBox.shrink(),
),
IconButton(