showTerminalBadgeProvider

This commit is contained in:
Ankit Mahato
2025-11-17 06:25:20 +05:30
parent db65c07dec
commit 6dfd8727e5
2 changed files with 16 additions and 7 deletions

View File

@@ -13,6 +13,7 @@ final historyCodePaneVisibleStateProvider = StateProvider<bool>((ref) => false);
final saveDataStateProvider = StateProvider<bool>((ref) => false); final saveDataStateProvider = StateProvider<bool>((ref) => false);
final clearDataStateProvider = StateProvider<bool>((ref) => false); final clearDataStateProvider = StateProvider<bool>((ref) => false);
final hasUnsavedChangesProvider = StateProvider<bool>((ref) => false); final hasUnsavedChangesProvider = StateProvider<bool>((ref) => false);
final showTerminalBadgeProvider = StateProvider<bool>((ref) => false);
// final nameTextFieldControllerProvider = // final nameTextFieldControllerProvider =
// StateProvider.autoDispose<TextEditingController>((ref) { // StateProvider.autoDispose<TextEditingController>((ref) {

View File

@@ -76,14 +76,22 @@ class Dashboard extends ConsumerWidget {
style: Theme.of(context).textTheme.labelSmall, style: Theme.of(context).textTheme.labelSmall,
), ),
kVSpacer10, kVSpacer10,
IconButton( Badge(
backgroundColor: Theme.of(context).colorScheme.error,
isLabelVisible:
ref.watch(showTerminalBadgeProvider) && railIdx != 3,
child: IconButton(
isSelected: railIdx == 3, isSelected: railIdx == 3,
onPressed: () { onPressed: () {
ref.read(navRailIndexStateProvider.notifier).state = 3; ref.read(navRailIndexStateProvider.notifier).state =
3;
ref.read(showTerminalBadgeProvider.notifier).state =
false;
}, },
icon: const Icon(Icons.terminal_outlined), icon: const Icon(Icons.terminal_outlined),
selectedIcon: const Icon(Icons.terminal), selectedIcon: const Icon(Icons.terminal),
), ),
),
Text( Text(
'Logs', 'Logs',
style: Theme.of(context).textTheme.labelSmall, style: Theme.of(context).textTheme.labelSmall,