fix: use theme-aware colors in voice test page for dark mode readability

Replace hardcoded Colors.grey with Theme.of(context).colorScheme for
result containers and status text so they're readable in both light
and dark themes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-02-24 09:21:06 -08:00
parent f8f0d17820
commit f7d39d8544
1 changed files with 15 additions and 11 deletions

View File

@ -301,7 +301,7 @@ class _VoiceTestPageState extends ConsumerState<VoiceTestPage> {
_provider == _VoiceProvider.openai _provider == _VoiceProvider.openai
? 'STT: gpt-4o-transcribe | TTS: tts-1' ? 'STT: gpt-4o-transcribe | TTS: tts-1'
: 'STT: faster-whisper | TTS: Kokoro', : 'STT: faster-whisper | TTS: Kokoro',
style: TextStyle(fontSize: 12, color: Colors.grey[500]), style: TextStyle(fontSize: 12, color: Theme.of(context).colorScheme.onSurfaceVariant),
), ),
), ),
), ),
@ -335,7 +335,7 @@ class _VoiceTestPageState extends ConsumerState<VoiceTestPage> {
padding: const EdgeInsets.only(top: 8), padding: const EdgeInsets.only(top: 8),
child: Text(_ttsStatus, child: Text(_ttsStatus,
style: style:
TextStyle(color: Colors.grey[600], fontSize: 13)), TextStyle(color: Theme.of(context).colorScheme.onSurfaceVariant, fontSize: 13)),
), ),
], ],
), ),
@ -370,7 +370,7 @@ class _VoiceTestPageState extends ConsumerState<VoiceTestPage> {
padding: const EdgeInsets.only(top: 8), padding: const EdgeInsets.only(top: 8),
child: Text(_sttStatus, child: Text(_sttStatus,
style: style:
TextStyle(color: Colors.grey[600], fontSize: 13)), TextStyle(color: Theme.of(context).colorScheme.onSurfaceVariant, fontSize: 13)),
), ),
if (_sttResult.isNotEmpty) if (_sttResult.isNotEmpty)
Container( Container(
@ -378,11 +378,13 @@ class _VoiceTestPageState extends ConsumerState<VoiceTestPage> {
margin: const EdgeInsets.only(top: 8), margin: const EdgeInsets.only(top: 8),
padding: const EdgeInsets.all(12), padding: const EdgeInsets.all(12),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.grey[100], color: Theme.of(context).colorScheme.surfaceContainerHighest,
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
child: child: Text(_sttResult,
Text(_sttResult, style: const TextStyle(fontSize: 16)), style: TextStyle(
fontSize: 16,
color: Theme.of(context).colorScheme.onSurface)),
), ),
], ],
), ),
@ -418,7 +420,7 @@ class _VoiceTestPageState extends ConsumerState<VoiceTestPage> {
padding: const EdgeInsets.only(top: 8), padding: const EdgeInsets.only(top: 8),
child: Text(_rtStatus, child: Text(_rtStatus,
style: style:
TextStyle(color: Colors.grey[600], fontSize: 13)), TextStyle(color: Theme.of(context).colorScheme.onSurfaceVariant, fontSize: 13)),
), ),
if (_rtResult.isNotEmpty) if (_rtResult.isNotEmpty)
Container( Container(
@ -426,11 +428,13 @@ class _VoiceTestPageState extends ConsumerState<VoiceTestPage> {
margin: const EdgeInsets.only(top: 8), margin: const EdgeInsets.only(top: 8),
padding: const EdgeInsets.all(12), padding: const EdgeInsets.all(12),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.grey[100], color: Theme.of(context).colorScheme.surfaceContainerHighest,
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
child: child: Text(_rtResult,
Text(_rtResult, style: const TextStyle(fontSize: 14)), style: TextStyle(
fontSize: 14,
color: Theme.of(context).colorScheme.onSurface)),
), ),
], ],
), ),
@ -458,7 +462,7 @@ class _VoiceTestPageState extends ConsumerState<VoiceTestPage> {
Padding( Padding(
padding: const EdgeInsets.only(top: 4), padding: const EdgeInsets.only(top: 4),
child: Text(subtitle, child: Text(subtitle,
style: TextStyle(fontSize: 12, color: Colors.grey[500])), style: TextStyle(fontSize: 12, color: Theme.of(context).colorScheme.onSurfaceVariant)),
), ),
const SizedBox(height: 12), const SizedBox(height: 12),
child, child,