mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: msg badge
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -434,43 +434,29 @@ 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,
|
||||
),
|
||||
? Badge(
|
||||
isLabelVisible:
|
||||
_mainController.msgBadgeMode != DynamicBadgeMode.hidden &&
|
||||
_mainController.msgUnReadCount.value.isNotEmpty,
|
||||
alignment:
|
||||
_mainController.msgBadgeMode == DynamicBadgeMode.number
|
||||
? Alignment(0, -0.5)
|
||||
: Alignment(0.5, -0.5),
|
||||
label: _mainController.msgBadgeMode ==
|
||||
DynamicBadgeMode.number &&
|
||||
_mainController.msgUnReadCount.value.isNotEmpty
|
||||
? Text(_mainController.msgUnReadCount.value.toString())
|
||||
: 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(),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user