From 6dfd8727e591780bb586e629eab1cb9c0605cb84 Mon Sep 17 00:00:00 2001 From: Ankit Mahato Date: Mon, 17 Nov 2025 06:25:20 +0530 Subject: [PATCH] showTerminalBadgeProvider --- lib/providers/ui_providers.dart | 1 + lib/screens/dashboard.dart | 22 +++++++++++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/lib/providers/ui_providers.dart b/lib/providers/ui_providers.dart index 4e5d217f..638d8e0b 100644 --- a/lib/providers/ui_providers.dart +++ b/lib/providers/ui_providers.dart @@ -13,6 +13,7 @@ final historyCodePaneVisibleStateProvider = StateProvider((ref) => false); final saveDataStateProvider = StateProvider((ref) => false); final clearDataStateProvider = StateProvider((ref) => false); final hasUnsavedChangesProvider = StateProvider((ref) => false); +final showTerminalBadgeProvider = StateProvider((ref) => false); // final nameTextFieldControllerProvider = // StateProvider.autoDispose((ref) { diff --git a/lib/screens/dashboard.dart b/lib/screens/dashboard.dart index 5ff7987a..21457302 100644 --- a/lib/screens/dashboard.dart +++ b/lib/screens/dashboard.dart @@ -76,13 +76,21 @@ class Dashboard extends ConsumerWidget { style: Theme.of(context).textTheme.labelSmall, ), kVSpacer10, - IconButton( - isSelected: railIdx == 3, - onPressed: () { - ref.read(navRailIndexStateProvider.notifier).state = 3; - }, - icon: const Icon(Icons.terminal_outlined), - selectedIcon: const Icon(Icons.terminal), + Badge( + backgroundColor: Theme.of(context).colorScheme.error, + isLabelVisible: + ref.watch(showTerminalBadgeProvider) && railIdx != 3, + child: IconButton( + isSelected: railIdx == 3, + onPressed: () { + ref.read(navRailIndexStateProvider.notifier).state = + 3; + ref.read(showTerminalBadgeProvider.notifier).state = + false; + }, + icon: const Icon(Icons.terminal_outlined), + selectedIcon: const Icon(Icons.terminal), + ), ), Text( 'Logs',