Revert "opt: msg badge"

This reverts commit 8ce5026778.
This commit is contained in:
bggRGjQaUbCoE
2025-01-08 22:04:54 +08:00
parent 8ce5026778
commit f9c365011b
2 changed files with 72 additions and 44 deletions

View File

@@ -90,29 +90,43 @@ class _HomePageState extends State<HomePage>
const SizedBox(width: 4), const SizedBox(width: 4),
Obx( Obx(
() => _homeController.isLogin.value () => _homeController.isLogin.value
? Badge( ? Stack(
isLabelVisible: clipBehavior: Clip.none,
_mainController.msgBadgeMode != DynamicBadgeMode.hidden && alignment: Alignment.center,
_mainController.msgUnReadCount.value.isNotEmpty, children: [
alignment: IconButton(
_mainController.msgBadgeMode == DynamicBadgeMode.number tooltip: '消息',
? Alignment(0, -0.5) onPressed: () {
: Alignment(0.5, -0.5), Get.toNamed('/whisper');
label: _mainController.msgBadgeMode == _mainController.msgUnReadCount.value = '';
DynamicBadgeMode.number && },
_mainController.msgUnReadCount.value.isNotEmpty icon: const Icon(
? Text(_mainController.msgUnReadCount.value.toString()) Icons.notifications_none,
: null, ),
child: 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,
),
),
),
],
) )
: const SizedBox.shrink(), : const SizedBox.shrink(),
), ),

View File

@@ -434,29 +434,43 @@ class _MainAppState extends State<MainApp>
const SizedBox(height: 8), const SizedBox(height: 8),
Obx( Obx(
() => _homeController.isLogin.value () => _homeController.isLogin.value
? Badge( ? Stack(
isLabelVisible: clipBehavior: Clip.none,
_mainController.msgBadgeMode != DynamicBadgeMode.hidden && alignment: Alignment.center,
_mainController.msgUnReadCount.value.isNotEmpty, children: [
alignment: IconButton(
_mainController.msgBadgeMode == DynamicBadgeMode.number tooltip: '消息',
? Alignment(0, -0.5) onPressed: () {
: Alignment(0.5, -0.5), Get.toNamed('/whisper');
label: _mainController.msgBadgeMode == _mainController.msgUnReadCount.value = '';
DynamicBadgeMode.number && },
_mainController.msgUnReadCount.value.isNotEmpty icon: const Icon(
? Text(_mainController.msgUnReadCount.value.toString()) Icons.notifications_none,
: null, ),
child: 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,
),
),
),
],
) )
: const SizedBox.shrink(), : const SizedBox.shrink(),
), ),