11import 'package:flutter/material.dart' ;
22
33import '../services/log_manager.dart' ;
4+ import '../theme.dart' ;
45
56class LogView extends StatefulWidget {
67 const LogView ({super .key});
@@ -42,21 +43,25 @@ class _LogViewState extends State<LogView> {
4243 Color _levelColor (LogLevel level) {
4344 switch (level) {
4445 case LogLevel .debug:
45- return Colors .blue ;
46+ return AppColors .osLogDebug ;
4647 case LogLevel .info:
47- return Colors .green ;
48+ return AppColors .osLogInfo ;
4849 case LogLevel .warn:
49- return Colors .amber ;
50+ return AppColors .osLogWarn ;
5051 case LogLevel .error:
51- return Colors .red ;
52+ return AppColors .osLogError ;
5253 }
5354 }
5455
5556 @override
5657 Widget build (BuildContext context) {
5758 final logs = LogManager ().logs;
59+ final textTheme = Theme .of (context).textTheme;
60+ final logEntryStyle = textTheme.labelSmall? .copyWith (
61+ fontFamily: 'monospace' ,
62+ );
5863
59- const logBackground = Color ( 0xFF1A1B1E ) ;
64+ const logBackground = AppColors .osLogBackground ;
6065
6166 return Semantics (
6267 label: 'log_view_container' ,
@@ -78,9 +83,9 @@ class _LogViewState extends State<LogView> {
7883 ),
7984 child: Row (
8085 children: [
81- const Text (
86+ Text (
8287 'LOGS' ,
83- style: TextStyle (
88+ style: textTheme.labelSmall ? . copyWith (
8489 fontWeight: FontWeight .bold,
8590 color: Colors .white,
8691 ),
@@ -90,7 +95,9 @@ class _LogViewState extends State<LogView> {
9095 label: 'log_view_count' ,
9196 child: Text (
9297 '(${logs .length })' ,
93- style: TextStyle (color: Colors .grey[400 ]),
98+ style: textTheme.labelSmall? .copyWith (
99+ color: AppColors .osGrey500,
100+ ),
94101 ),
95102 ),
96103 const Spacer (),
@@ -99,10 +106,10 @@ class _LogViewState extends State<LogView> {
99106 label: 'log_view_clear_button' ,
100107 child: GestureDetector (
101108 onTap: () => LogManager ().clear (),
102- child: Icon (
109+ child: const Icon (
103110 Icons .delete,
104111 size: 18 ,
105- color: Colors .grey[ 400 ] ,
112+ color: AppColors .osGrey500 ,
106113 ),
107114 ),
108115 ),
@@ -112,7 +119,7 @@ class _LogViewState extends State<LogView> {
112119 ? Icons .expand_less
113120 : Icons .expand_more,
114121 size: 20 ,
115- color: Colors .grey[ 400 ] ,
122+ color: AppColors .osGrey500 ,
116123 ),
117124 ],
118125 ),
@@ -130,7 +137,9 @@ class _LogViewState extends State<LogView> {
130137 child: Center (
131138 child: Text (
132139 'No logs yet' ,
133- style: TextStyle (color: Colors .grey[500 ]),
140+ style: textTheme.bodyMedium? .copyWith (
141+ color: AppColors .osGrey500,
142+ ),
134143 ),
135144 ),
136145 )
@@ -153,10 +162,8 @@ class _LogViewState extends State<LogView> {
153162 label: 'log_entry_${index }_timestamp' ,
154163 child: Text (
155164 entry.formattedTime,
156- style: TextStyle (
157- fontSize: 11 ,
158- color: Colors .grey[500 ],
159- fontFamily: 'monospace' ,
165+ style: logEntryStyle? .copyWith (
166+ color: AppColors .osLogTimestamp,
160167 ),
161168 ),
162169 ),
@@ -165,11 +172,9 @@ class _LogViewState extends State<LogView> {
165172 label: 'log_entry_${index }_level' ,
166173 child: Text (
167174 entry.levelLabel,
168- style: TextStyle (
169- fontSize: 11 ,
175+ style: logEntryStyle? .copyWith (
170176 fontWeight: FontWeight .bold,
171177 color: _levelColor (entry.level),
172- fontFamily: 'monospace' ,
173178 ),
174179 ),
175180 ),
@@ -179,10 +184,8 @@ class _LogViewState extends State<LogView> {
179184 label: 'log_entry_${index }_message' ,
180185 child: Text (
181186 '${entry .tag }: ${entry .message }' ,
182- style: const TextStyle (
183- fontSize: 11 ,
184- fontFamily: 'monospace' ,
185- color: Colors .white70,
187+ style: logEntryStyle? .copyWith (
188+ color: Colors .white,
186189 ),
187190 ),
188191 ),
0 commit comments