From 962bf0f230144885504c042bd4d131f5c7a890d0 Mon Sep 17 00:00:00 2001 From: Ashita Prasad Date: Sat, 17 May 2025 22:51:32 +0530 Subject: [PATCH] Update dashboard.dart --- lib/screens/dashboard.dart | 204 ++++++++++++++++++------------------- 1 file changed, 101 insertions(+), 103 deletions(-) diff --git a/lib/screens/dashboard.dart b/lib/screens/dashboard.dart index 8955dd3e..29bb7907 100644 --- a/lib/screens/dashboard.dart +++ b/lib/screens/dashboard.dart @@ -20,126 +20,124 @@ class Dashboard extends ConsumerWidget { final settings = ref.watch(settingsProvider); return Scaffold( body: SafeArea( - child: Stack( - children: [ - Row( - children: [ + child: Row( + children: [ + Column( + children: [ + SizedBox( + height: kIsMacOS ? 32.0 : 16.0, + width: 64, + ), Column( + mainAxisSize: MainAxisSize.min, children: [ - SizedBox( - height: kIsMacOS ? 32.0 : 16.0, - width: 64, + IconButton( + isSelected: railIdx == 0, + onPressed: () { + ref.read(navRailIndexStateProvider.notifier).state = 0; + }, + icon: const Icon(Icons.auto_awesome_mosaic_outlined), + selectedIcon: const Icon(Icons.auto_awesome_mosaic), ), - Column( - mainAxisSize: MainAxisSize.min, - children: [ - IconButton( - isSelected: railIdx == 0, - onPressed: () { - ref.read(navRailIndexStateProvider.notifier).state = 0; - }, - icon: const Icon(Icons.auto_awesome_mosaic_outlined), - selectedIcon: const Icon(Icons.auto_awesome_mosaic), - ), - Text( - 'Requests', - style: Theme.of(context).textTheme.labelSmall, - ), - kVSpacer10, - IconButton( - isSelected: railIdx == 1, - onPressed: () { - ref.read(navRailIndexStateProvider.notifier).state = 1; - }, - icon: const Icon(Icons.laptop_windows_outlined), - selectedIcon: const Icon(Icons.laptop_windows), - ), - Text( - 'Variables', - style: Theme.of(context).textTheme.labelSmall, - ), - kVSpacer10, - IconButton( - isSelected: railIdx == 2, - onPressed: () { - ref.read(navRailIndexStateProvider.notifier).state = 2; - }, - icon: const Icon(Icons.history_outlined), - selectedIcon: const Icon(Icons.history_rounded), - ), - Text( - 'History', - style: Theme.of(context).textTheme.labelSmall, - ), - ], + Text( + 'Requests', + style: Theme.of(context).textTheme.labelSmall, ), - Expanded( - child: Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Padding( - padding: const EdgeInsets.only(bottom: 16.0), - child: NavbarButton( - railIdx: railIdx, - selectedIcon: Icons.help, - icon: Icons.help_outline, - label: 'About', - showLabel: false, - isCompact: true, - onTap: () { - showAboutAppDialog(context); - }, - ), - ), - Padding( - padding: const EdgeInsets.only(bottom: 16.0), - child: NavbarButton( - railIdx: railIdx, - buttonIdx: 3, - selectedIcon: Icons.settings, - icon: Icons.settings_outlined, - label: 'Settings', - showLabel: false, - isCompact: true, - ), - ), - ], - ), + kVSpacer10, + IconButton( + isSelected: railIdx == 1, + onPressed: () { + ref.read(navRailIndexStateProvider.notifier).state = 1; + }, + icon: const Icon(Icons.laptop_windows_outlined), + selectedIcon: const Icon(Icons.laptop_windows), + ), + Text( + 'Variables', + style: Theme.of(context).textTheme.labelSmall, + ), + kVSpacer10, + IconButton( + isSelected: railIdx == 2, + onPressed: () { + ref.read(navRailIndexStateProvider.notifier).state = 2; + }, + icon: const Icon(Icons.history_outlined), + selectedIcon: const Icon(Icons.history_rounded), + ), + Text( + 'History', + style: Theme.of(context).textTheme.labelSmall, ), ], ), - VerticalDivider( - thickness: 1, - width: 1, - color: Theme.of(context).colorScheme.surfaceContainerHigh, - ), Expanded( - child: IndexedStack( - alignment: AlignmentDirectional.topCenter, - index: railIdx, - children: const [ - HomePage(), - EnvironmentPage(), - HistoryPage(), - SettingsPage(), + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Padding( + padding: const EdgeInsets.only(bottom: 16.0), + child: NavbarButton( + railIdx: railIdx, + selectedIcon: Icons.help, + icon: Icons.help_outline, + label: 'About', + showLabel: false, + isCompact: true, + onTap: () { + showAboutAppDialog(context); + }, + ), + ), + Padding( + padding: const EdgeInsets.only(bottom: 16.0), + child: NavbarButton( + railIdx: railIdx, + buttonIdx: 3, + selectedIcon: Icons.settings, + icon: Icons.settings_outlined, + label: 'Settings', + showLabel: false, + isCompact: true, + ), + ), ], ), - ) + ), ], ), - - // DashBot Overlay - if (isDashBotVisible) - Positioned( - bottom: 20, - right: 20, - child: const DashBotOverlay(), + VerticalDivider( + thickness: 1, + width: 1, + color: Theme.of(context).colorScheme.surfaceContainerHigh, + ), + Expanded( + child: IndexedStack( + alignment: AlignmentDirectional.topCenter, + index: railIdx, + children: const [ + HomePage(), + EnvironmentPage(), + HistoryPage(), + SettingsPage(), + ], ), + ) ], ), ), floatingActionButton: settings.isDashBotEnabled - ? const DashBotFAB() + ? FloatingActionButton( + onPressed: () => showModalBottomSheet( + context: context, + isScrollControlled: true, + builder: (context) => const Padding( + padding: EdgeInsets.all(16.0), + child: DashBotWidget(), + ), + ), + child: const Icon(Icons.help_outline), + ) : null, ); }