@@ -25,7 +25,7 @@ class PredictionPanel extends StatelessWidget {
2525 Text (
2626 'Prediction & Forecasting' ,
2727 style: TextStyle (
28- color: AppTheme .textPrimary ,
28+ color: AppTheme .textPrimaryFor (context) ,
2929 fontSize: 14 ,
3030 fontWeight: FontWeight .w600,
3131 ),
@@ -34,17 +34,19 @@ class PredictionPanel extends StatelessWidget {
3434 ),
3535 Divider (height: 24 , color: Theme .of (context).dividerColor),
3636 if (prediction == null )
37- _buildEmptyState ()
37+ _buildEmptyState (context )
3838 else ...[
39- _buildRiskScore (prediction.riskScore),
39+ _buildRiskScore (context, prediction.riskScore),
4040 const SizedBox (height: 16 ),
4141 _buildEtaRow (
42+ context,
4243 'Memory Exhaustion' ,
4344 prediction.memoryExhaustionEtaSec,
4445 Icons .memory,
4546 ),
4647 const SizedBox (height: 8 ),
4748 _buildEtaRow (
49+ context,
4850 'CPU Saturation' ,
4951 prediction.cpuCriticalEtaSec,
5052 Icons .speed,
@@ -56,19 +58,19 @@ class PredictionPanel extends StatelessWidget {
5658 );
5759 }
5860
59- Widget _buildEmptyState () {
61+ Widget _buildEmptyState (BuildContext context ) {
6062 return Center (
6163 child: Padding (
6264 padding: const EdgeInsets .all (24.0 ),
6365 child: Text (
6466 'Waiting for trend data...' ,
65- style: TextStyle (color: AppTheme .textMuted ),
67+ style: TextStyle (color: AppTheme .textMutedFor (context) ),
6668 ),
6769 ),
6870 );
6971 }
7072
71- Widget _buildRiskScore (double score) {
73+ Widget _buildRiskScore (BuildContext context, double score) {
7274 Color color = AppTheme .stressLow;
7375 if (score > 60 ) {
7476 color = AppTheme .stressCritical;
@@ -83,7 +85,8 @@ class PredictionPanel extends StatelessWidget {
8385 mainAxisAlignment: MainAxisAlignment .spaceBetween,
8486 children: [
8587 Text ('Degradation Risk' ,
86- style: TextStyle (color: AppTheme .textSecondary, fontSize: 12 )),
88+ style: TextStyle (
89+ color: AppTheme .textSecondaryFor (context), fontSize: 12 )),
8790 Text ('${score .toStringAsFixed (0 )}%' ,
8891 style: TextStyle (color: color, fontWeight: FontWeight .bold)),
8992 ],
@@ -93,7 +96,8 @@ class PredictionPanel extends StatelessWidget {
9396 borderRadius: BorderRadius .circular (4 ),
9497 child: LinearProgressIndicator (
9598 value: score / 100 ,
96- backgroundColor: AppTheme .surfaceLight,
99+ backgroundColor:
100+ Theme .of (context).dividerColor.withValues (alpha: 0.2 ),
97101 valueColor: AlwaysStoppedAnimation <Color >(color),
98102 minHeight: 6 ,
99103 ),
@@ -102,9 +106,10 @@ class PredictionPanel extends StatelessWidget {
102106 );
103107 }
104108
105- Widget _buildEtaRow (String label, double ? etaSec, IconData icon) {
109+ Widget _buildEtaRow (
110+ BuildContext context, String label, double ? etaSec, IconData icon) {
106111 String text = 'Stable' ;
107- Color color = AppTheme .textMuted ;
112+ Color color = AppTheme .textMutedFor (context) ;
108113
109114 if (etaSec != null ) {
110115 if (etaSec < 60 ) {
@@ -120,15 +125,16 @@ class PredictionPanel extends StatelessWidget {
120125 return Container (
121126 padding: const EdgeInsets .symmetric (horizontal: 12 , vertical: 8 ),
122127 decoration: BoxDecoration (
123- color: AppTheme .surfaceLight ,
128+ color: AppTheme .surfaceLightFor (context) ,
124129 borderRadius: BorderRadius .circular (6 ),
125130 ),
126131 child: Row (
127132 children: [
128- Icon (icon, size: 14 , color: AppTheme .textSecondary ),
133+ Icon (icon, size: 14 , color: AppTheme .textSecondaryFor (context) ),
129134 const SizedBox (width: 8 ),
130135 Text (label,
131- style: TextStyle (color: AppTheme .textSecondary, fontSize: 13 )),
136+ style: TextStyle (
137+ color: AppTheme .textSecondaryFor (context), fontSize: 13 )),
132138 const Spacer (),
133139 Text (
134140 text,
0 commit comments