Red dot unread indicator in bottom tabs, keep numeric unreads only for the lists; fixed unread indicator wasn't on all screens

This commit is contained in:
Serge Tarkovski
2026-04-22 01:57:12 +03:00
parent 0c1e163b88
commit d3c7d8e43a
3 changed files with 20 additions and 2 deletions
+2
View File
@@ -429,6 +429,8 @@ class _ContactsScreenState extends State<ContactsScreen>
selectedIndex: 0,
onDestinationSelected: (index) =>
_handleQuickSwitch(index, context),
contactsUnreadCount: connector.getTotalContactsUnreadCount(),
channelsUnreadCount: connector.getTotalChannelsUnreadCount(),
),
),
),
@@ -431,6 +431,12 @@ class _LineOfSightMapScreenState extends State<LineOfSightMapScreen> {
child: QuickSwitchBar(
selectedIndex: 2,
onDestinationSelected: (index) => _handleQuickSwitch(index, context),
contactsUnreadCount: context
.watch<MeshCoreConnector>()
.getTotalContactsUnreadCount(),
channelsUnreadCount: context
.watch<MeshCoreConnector>()
.getTotalChannelsUnreadCount(),
),
),
);
+12 -2
View File
@@ -2,7 +2,6 @@ import 'dart:ui';
import 'package:flutter/material.dart';
import '../l10n/l10n.dart';
import 'unread_badge.dart';
class QuickSwitchBar extends StatelessWidget {
final int selectedIndex;
@@ -109,7 +108,18 @@ class QuickSwitchBar extends StatelessWidget {
clipBehavior: Clip.none,
children: [
icon,
Positioned(right: -6, top: -4, child: UnreadBadge(count: count)),
Positioned(
right: -2,
top: -2,
child: Container(
width: 8,
height: 8,
decoration: const BoxDecoration(
color: Colors.redAccent,
shape: BoxShape.circle,
),
),
),
],
);
}