From d3c7d8e43aa3660d95c1d862d3e07e76b48bed6d Mon Sep 17 00:00:00 2001 From: Serge Tarkovski Date: Wed, 22 Apr 2026 01:57:12 +0300 Subject: [PATCH] Red dot unread indicator in bottom tabs, keep numeric unreads only for the lists; fixed unread indicator wasn't on all screens --- lib/screens/contacts_screen.dart | 2 ++ lib/screens/line_of_sight_map_screen.dart | 6 ++++++ lib/widgets/quick_switch_bar.dart | 14 ++++++++++++-- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/lib/screens/contacts_screen.dart b/lib/screens/contacts_screen.dart index 54d32990..a034d04a 100644 --- a/lib/screens/contacts_screen.dart +++ b/lib/screens/contacts_screen.dart @@ -429,6 +429,8 @@ class _ContactsScreenState extends State selectedIndex: 0, onDestinationSelected: (index) => _handleQuickSwitch(index, context), + contactsUnreadCount: connector.getTotalContactsUnreadCount(), + channelsUnreadCount: connector.getTotalChannelsUnreadCount(), ), ), ), diff --git a/lib/screens/line_of_sight_map_screen.dart b/lib/screens/line_of_sight_map_screen.dart index ec8a391f..1148edf0 100644 --- a/lib/screens/line_of_sight_map_screen.dart +++ b/lib/screens/line_of_sight_map_screen.dart @@ -431,6 +431,12 @@ class _LineOfSightMapScreenState extends State { child: QuickSwitchBar( selectedIndex: 2, onDestinationSelected: (index) => _handleQuickSwitch(index, context), + contactsUnreadCount: context + .watch() + .getTotalContactsUnreadCount(), + channelsUnreadCount: context + .watch() + .getTotalChannelsUnreadCount(), ), ), ); diff --git a/lib/widgets/quick_switch_bar.dart b/lib/widgets/quick_switch_bar.dart index 4f014bd3..40dcb59a 100644 --- a/lib/widgets/quick_switch_bar.dart +++ b/lib/widgets/quick_switch_bar.dart @@ -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, + ), + ), + ), ], ); }