@@ -7,6 +7,7 @@ import 'package:sentracore_dashboard/screens/processes_screen.dart';
77import 'package:sentracore_dashboard/screens/diagnostics_screen.dart' ;
88import 'package:sentracore_dashboard/theme/app_theme.dart' ;
99import 'package:sentracore_dashboard/widgets/connection_banner.dart' ;
10+ import 'package:sentracore_dashboard/providers/settings_provider.dart' ;
1011
1112/// Root shell with persistent navigation rail and page switching.
1213class DashboardScreen extends StatefulWidget {
@@ -45,10 +46,10 @@ class _DashboardScreenState extends State<DashboardScreen> {
4546 provider: provider,
4647 ),
4748 // ── Vertical Divider ──
48- const VerticalDivider (
49+ VerticalDivider (
4950 width: 1 ,
5051 thickness: 1 ,
51- color: AppTheme .border ,
52+ color: Theme . of (context).dividerColor ,
5253 ),
5354 // ── Page Content ──
5455 Expanded (child: _pages[_selectedIndex]),
@@ -82,77 +83,125 @@ class _SentraNavRail extends StatelessWidget {
8283
8384 return Container (
8485 width: 72 ,
85- color: AppTheme .surface,
86+ decoration: BoxDecoration (
87+ color: Theme .of (context).colorScheme.surface,
88+ border: Border (
89+ right: BorderSide (
90+ color: Theme .of (context).dividerColor,
91+ width: 1 ,
92+ ),
93+ ),
94+ ),
8695 child: Column (
8796 children: [
8897 const SizedBox (height: 12 ),
8998 // Logo / brand mark
9099 Container (
91- width: 40 ,
92- height: 40 ,
100+ width: 44 ,
101+ height: 44 ,
93102 decoration: BoxDecoration (
94- color: AppTheme .primary.withValues (alpha: 0.15 ),
95- borderRadius: BorderRadius .circular (10 ),
96- border:
97- Border .all (color: AppTheme .primary.withValues (alpha: 0.3 )),
98- image: const DecorationImage (
99- image: AssetImage ('assets/brandmark.jpeg' ),
103+ gradient: LinearGradient (
104+ begin: Alignment .topLeft,
105+ end: Alignment .bottomRight,
106+ colors: [
107+ AppTheme .primary,
108+ AppTheme .primary.withValues (alpha: 0.6 ),
109+ ],
110+ ),
111+ borderRadius: BorderRadius .circular (12 ),
112+ boxShadow: [
113+ BoxShadow (
114+ color: AppTheme .primary.withValues (alpha: 0.3 ),
115+ blurRadius: 8 ,
116+ offset: const Offset (0 , 4 ),
117+ ),
118+ ],
119+ ),
120+ child: ClipRRect (
121+ borderRadius: BorderRadius .circular (12 ),
122+ child: Image .asset (
123+ 'assets/brandmark.jpeg' ,
100124 fit: BoxFit .cover,
101125 ),
102126 ),
103127 ),
104- const SizedBox (height: 20 ),
128+ const SizedBox (height: 24 ),
105129 // Stability mini-score
106130 Container (
107- padding: const EdgeInsets .symmetric (vertical: 6 , horizontal: 4 ),
131+ padding: const EdgeInsets .symmetric (vertical: 8 , horizontal: 6 ),
108132 decoration: BoxDecoration (
109133 color: stabilityColor.withValues (alpha: 0.1 ),
110- borderRadius: BorderRadius .circular (8 ),
111- border: Border .all (color: stabilityColor.withValues (alpha: 0.25 )),
134+ borderRadius: BorderRadius .circular (12 ),
135+ border: Border .all (color: stabilityColor.withValues (alpha: 0.2 )),
112136 ),
113137 child: Column (
114138 children: [
115139 Text (
116140 stabilityScore,
117141 style: TextStyle (
118142 color: stabilityColor,
119- fontSize: 14 ,
120- fontWeight: FontWeight .w700,
143+ fontSize: 16 ,
144+ fontWeight: FontWeight .w800,
145+ fontFamily: 'Outfit' ,
121146 ),
122147 ),
123148 Text (
124- 'STA ' ,
149+ 'HEALTH ' ,
125150 style: TextStyle (
126- color: AppTheme .textMuted, fontSize: 8 , letterSpacing: 1 ),
151+ color: stabilityColor.withValues (alpha: 0.7 ),
152+ fontSize: 8 ,
153+ fontWeight: FontWeight .w700,
154+ letterSpacing: 0.5 ,
155+ ),
127156 ),
128157 ],
129158 ),
130159 ),
131- const SizedBox (height: 16 ),
132- const Divider (color: AppTheme .border, indent: 8 , endIndent: 8 ),
160+ const SizedBox (height: 20 ),
161+ Padding (
162+ padding: const EdgeInsets .symmetric (horizontal: 12 ),
163+ child: Divider (color: Theme .of (context).dividerColor),
164+ ),
165+ const SizedBox (height: 8 ),
133166 // Nav items
134- _navItem (context, 0 , Icons .dashboard_outlined, Icons .dashboard ,
135- 'Overview' ),
136- _navItem (context, 1 , Icons .show_chart_outlined, Icons .show_chart ,
137- 'Performance' ),
138- _navItem (
139- context, 2 , Icons .memory_outlined, Icons .memory, 'Processes' ),
140- _navItem (context, 3 , Icons .bug_report_outlined, Icons .bug_report ,
141- 'Diagnostics' ),
167+ _navItem (context, 0 , Icons .grid_view_outlined ,
168+ Icons .grid_view_rounded, 'Overview' ),
169+ _navItem (context, 1 , Icons .analytics_outlined ,
170+ Icons .analytics_rounded, 'Performance' ),
171+ _navItem (context, 2 , Icons .layers_outlined, Icons .layers_rounded,
172+ 'Processes' ),
173+ _navItem (context, 3 , Icons .troubleshoot_outlined ,
174+ Icons .troubleshoot_rounded, 'Diagnostics' ),
142175 const Spacer (),
176+ // Theme Toggle
177+ Consumer <SettingsProvider >(
178+ builder: (context, settings, _) => IconButton (
179+ onPressed: () => settings.toggleTheme (),
180+ icon: Icon (
181+ settings.isDarkMode
182+ ? Icons .light_mode_outlined
183+ : Icons .dark_mode_outlined,
184+ color: Theme .of (context).iconTheme.color,
185+ size: 20 ,
186+ ),
187+ ),
188+ ),
189+ const SizedBox (height: 8 ),
143190 // Connection status dot
144191 Container (
145192 width: 8 ,
146193 height: 8 ,
147- margin: const EdgeInsets .only (bottom: 16 ),
194+ margin: const EdgeInsets .only (bottom: 20 ),
148195 decoration: BoxDecoration (
149- color: provider.connected ? AppTheme .accent : AppTheme .error,
196+ color: provider.connected ? AppTheme .success : AppTheme .error,
150197 shape: BoxShape .circle,
151198 boxShadow: [
152199 BoxShadow (
153- color: (provider.connected ? AppTheme .accent : AppTheme .error)
154- .withValues (alpha: 0.5 ),
155- blurRadius: 6 ,
200+ color:
201+ (provider.connected ? AppTheme .success : AppTheme .error)
202+ .withValues (alpha: 0.4 ),
203+ blurRadius: 8 ,
204+ spreadRadius: 1 ,
156205 )
157206 ],
158207 ),
0 commit comments