Skip to content

A cross platform Audiobookshelf client for Android and iOS

Dart

Fix admin screens for light mode support

Nathan Poulson731260f536bb
diff --git a/lib/screens/admin_podcasts_screen.dart b/lib/screens/admin_podcasts_screen.dart
index 9a03e0e8..01d54587 100644
--- a/lib/screens/admin_podcasts_screen.dart
+++ b/lib/screens/admin_podcasts_screen.dart
@@ -72,13 +72,13 @@ class _AdminPodcastsScreenState extends State<AdminPodcastsScreen> {
child: Row(children: [
const Expanded(child: AbsorbPageHeader(title: 'Podcasts', padding: EdgeInsets.zero)),
_checkingEpisodes
- ? const Padding(padding: EdgeInsets.all(12),
- child: SizedBox(width: 18, height: 18, child: CircularProgressIndicator(strokeWidth: 1.5, color: Colors.white38)))
+ ? Padding(padding: const EdgeInsets.all(12),
+ child: SizedBox(width: 18, height: 18, child: CircularProgressIndicator(strokeWidth: 1.5, color: cs.onSurfaceVariant.withValues(alpha: 0.6))))
: IconButton(
- icon: const Icon(Icons.refresh_rounded, color: Colors.white38, size: 22),
+ icon: Icon(Icons.refresh_rounded, color: cs.onSurfaceVariant.withValues(alpha: 0.6), size: 22),
tooltip: 'Check for new episodes',
onPressed: _checkNewEpisodes),
- IconButton(icon: const Icon(Icons.close_rounded, color: Colors.white38), onPressed: () => Navigator.pop(context)),
+ IconButton(icon: Icon(Icons.close_rounded, color: cs.onSurfaceVariant.withValues(alpha: 0.6)), onPressed: () => Navigator.pop(context)),
]),
),
const SizedBox(height: 12),
@@ -96,11 +96,11 @@ class _AdminPodcastsScreenState extends State<AdminPodcastsScreen> {
Widget _buildShowList(ColorScheme cs, TextTheme tt) {
if (_shows.isEmpty) {
return Center(child: Column(mainAxisSize: MainAxisSize.min, children: [
- Icon(Icons.podcasts_rounded, size: 48, color: Colors.white.withValues(alpha: 0.1)),
+ Icon(Icons.podcasts_rounded, size: 48, color: cs.onSurface.withValues(alpha: 0.1)),
const SizedBox(height: 12),
- Text('No podcasts yet', style: tt.bodyMedium?.copyWith(color: Colors.white.withValues(alpha: 0.3))),
+ Text('No podcasts yet', style: tt.bodyMedium?.copyWith(color: cs.onSurface.withValues(alpha: 0.3))),
const SizedBox(height: 4),
- Text('Tap + to search and add shows', style: tt.bodySmall?.copyWith(color: Colors.white.withValues(alpha: 0.2))),
+ Text('Tap + to search and add shows', style: tt.bodySmall?.copyWith(color: cs.onSurface.withValues(alpha: 0.2))),
]));
}
@@ -130,13 +130,13 @@ class _AdminPodcastsScreenState extends State<AdminPodcastsScreen> {
ClipRRect(borderRadius: BorderRadius.circular(10), child: _coverImg(cs, itemId)),
const SizedBox(width: 12),
Expanded(child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
- Text(title, style: tt.bodyMedium?.copyWith(fontWeight: FontWeight.w600, color: Colors.white), maxLines: 2, overflow: TextOverflow.ellipsis),
+ Text(title, style: tt.bodyMedium?.copyWith(fontWeight: FontWeight.w600, color: cs.onSurface), maxLines: 2, overflow: TextOverflow.ellipsis),
if (author.isNotEmpty) ...[const SizedBox(height: 2),
- Text(author, style: tt.bodySmall?.copyWith(color: Colors.white38), maxLines: 1, overflow: TextOverflow.ellipsis)],
+ Text(author, style: tt.bodySmall?.copyWith(color: cs.onSurfaceVariant.withValues(alpha: 0.6)), maxLines: 1, overflow: TextOverflow.ellipsis)],
const SizedBox(height: 4),
Text('$numEps episodes', style: tt.labelSmall?.copyWith(color: cs.primary.withValues(alpha: 0.7), fontSize: 11)),
])),
- Icon(Icons.chevron_right_rounded, color: Colors.white.withValues(alpha: 0.15)),
+ Icon(Icons.chevron_right_rounded, color: cs.onSurface.withValues(alpha: 0.15)),
]),
),
),
@@ -261,22 +261,22 @@ class _PodcastSearchSheetState extends State<_PodcastSearchSheet> {
child: Row(
children: [
Expanded(
- child: Text('Add Podcast', style: tt.titleMedium?.copyWith(fontWeight: FontWeight.w700, color: Colors.white)),
+ child: Text('Add Podcast', style: tt.titleMedium?.copyWith(fontWeight: FontWeight.w700, color: cs.onSurface)),
),
IconButton(
- icon: const Icon(Icons.close_rounded, color: Colors.white38, size: 20),
+ icon: Icon(Icons.close_rounded, color: cs.onSurfaceVariant.withValues(alpha: 0.6), size: 20),
onPressed: () => Navigator.pop(context),
),
],
),
),
_buildSearchBar(cs, tt),
- const Divider(height: 1, color: Colors.white10),
+ Divider(height: 1, color: cs.onSurface.withValues(alpha: 0.1)),
Expanded(
child: _searching
? const Center(child: CircularProgressIndicator(strokeWidth: 2))
: _results.isEmpty
- ? Center(child: Text('Search iTunes to find podcasts', style: tt.bodySmall?.copyWith(color: Colors.white24)))
+ ? Center(child: Text('Search iTunes to find podcasts', style: tt.bodySmall?.copyWith(color: cs.onSurface.withValues(alpha: 0.24))))
: _buildResultsList(cs, tt, sc),
),
],
@@ -292,20 +292,20 @@ class _PodcastSearchSheetState extends State<_PodcastSearchSheet> {
child: TextField(
controller: _ctrl,
autofocus: true,
- style: const TextStyle(color: Colors.white),
+ style: TextStyle(color: cs.onSurface),
onSubmitted: (_) => _search(),
decoration: InputDecoration(
hintText: 'Search for podcasts…',
- hintStyle: TextStyle(color: Colors.white.withValues(alpha: 0.25)),
- prefixIcon: Icon(Icons.search_rounded, color: Colors.white.withValues(alpha: 0.3)),
+ hintStyle: TextStyle(color: cs.onSurface.withValues(alpha: 0.25)),
+ prefixIcon: Icon(Icons.search_rounded, color: cs.onSurface.withValues(alpha: 0.3)),
suffixIcon: _searching
- ? const Padding(
- padding: EdgeInsets.all(12),
- child: SizedBox(width: 18, height: 18, child: CircularProgressIndicator(strokeWidth: 1.5, color: Colors.white38)),
+ ? Padding(
+ padding: const EdgeInsets.all(12),
+ child: SizedBox(width: 18, height: 18, child: CircularProgressIndicator(strokeWidth: 1.5, color: cs.onSurfaceVariant.withValues(alpha: 0.6))),
)
: IconButton(icon: Icon(Icons.arrow_forward_rounded, color: cs.primary), onPressed: _search),
filled: true,
- fillColor: Colors.white.withValues(alpha: 0.05),
+ fillColor: cs.onSurface.withValues(alpha: 0.05),
border: OutlineInputBorder(borderRadius: BorderRadius.circular(14), borderSide: BorderSide.none),
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
),
@@ -331,7 +331,7 @@ class _PodcastSearchSheetState extends State<_PodcastSearchSheet> {
child: Container(
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
- color: Colors.white.withValues(alpha: 0.04),
+ color: cs.onSurface.withValues(alpha: 0.04),
borderRadius: BorderRadius.circular(14),
),
child: Row(
@@ -353,16 +353,16 @@ class _PodcastSearchSheetState extends State<_PodcastSearchSheet> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
- Text(title, style: tt.bodyMedium?.copyWith(fontWeight: FontWeight.w600, color: Colors.white), maxLines: 2, overflow: TextOverflow.ellipsis),
+ Text(title, style: tt.bodyMedium?.copyWith(fontWeight: FontWeight.w600, color: cs.onSurface), maxLines: 2, overflow: TextOverflow.ellipsis),
if (author.isNotEmpty) ...[
const SizedBox(height: 2),
- Text(author, style: tt.bodySmall?.copyWith(color: Colors.white38), maxLines: 1, overflow: TextOverflow.ellipsis),
+ Text(author, style: tt.bodySmall?.copyWith(color: cs.onSurfaceVariant.withValues(alpha: 0.6)), maxLines: 1, overflow: TextOverflow.ellipsis),
],
],
),
),
const SizedBox(width: 8),
- Icon(Icons.chevron_right_rounded, color: Colors.white.withValues(alpha: 0.15)),
+ Icon(Icons.chevron_right_rounded, color: cs.onSurface.withValues(alpha: 0.15)),
],
),
),
@@ -479,7 +479,7 @@ class _PodcastPreviewScreenState extends State<_PodcastPreviewScreen> {
padding: const EdgeInsets.fromLTRB(4, 4, 8, 0),
child: Row(
children: [
- IconButton(icon: const Icon(Icons.arrow_back_rounded, color: Colors.white54), onPressed: () => Navigator.pop(context)),
+ IconButton(icon: Icon(Icons.arrow_back_rounded, color: cs.onSurface.withValues(alpha: 0.54)), onPressed: () => Navigator.pop(context)),
const Spacer(),
],
),
@@ -502,12 +502,12 @@ class _PodcastPreviewScreenState extends State<_PodcastPreviewScreen> {
const SizedBox(height: 16),
Text(
_title,
- style: tt.titleLarge?.copyWith(fontWeight: FontWeight.w700, color: Colors.white),
+ style: tt.titleLarge?.copyWith(fontWeight: FontWeight.w700, color: cs.onSurface),
textAlign: TextAlign.center,
),
if (_author.isNotEmpty) ...[
const SizedBox(height: 4),
- Text(_author, style: tt.bodyMedium?.copyWith(color: Colors.white38), textAlign: TextAlign.center),
+ Text(_author, style: tt.bodyMedium?.copyWith(color: cs.onSurfaceVariant.withValues(alpha: 0.6)), textAlign: TextAlign.center),
],
const SizedBox(height: 12),
@@ -537,12 +537,12 @@ class _PodcastPreviewScreenState extends State<_PodcastPreviewScreen> {
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
- Icon(Icons.rss_feed_rounded, size: 14, color: Colors.white.withValues(alpha: 0.25)),
+ Icon(Icons.rss_feed_rounded, size: 14, color: cs.onSurface.withValues(alpha: 0.25)),
const SizedBox(width: 6),
Flexible(
child: Text(
_feedUrl,
- style: tt.labelSmall?.copyWith(color: Colors.white.withValues(alpha: 0.25), fontSize: 10),
+ style: tt.labelSmall?.copyWith(color: cs.onSurface.withValues(alpha: 0.25), fontSize: 10),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
@@ -555,7 +555,7 @@ class _PodcastPreviewScreenState extends State<_PodcastPreviewScreen> {
if (_description.isNotEmpty) ...[
Text(
_description,
- style: tt.bodySmall?.copyWith(color: Colors.white.withValues(alpha: 0.5), height: 1.5),
+ style: tt.bodySmall?.copyWith(color: cs.onSurface.withValues(alpha: 0.5), height: 1.5),
maxLines: 6,
overflow: TextOverflow.ellipsis,
),
@@ -571,7 +571,7 @@ class _PodcastPreviewScreenState extends State<_PodcastPreviewScreen> {
else if (_feedEpisodes.isNotEmpty) ...[
Text(
'${_feedEpisodes.length} episodes in feed',
- style: tt.labelMedium?.copyWith(color: Colors.white38, fontWeight: FontWeight.w600),
+ style: tt.labelMedium?.copyWith(color: cs.onSurfaceVariant.withValues(alpha: 0.6), fontWeight: FontWeight.w600),
),
const SizedBox(height: 8),
// Show first 5 episodes as preview
@@ -588,7 +588,7 @@ class _PodcastPreviewScreenState extends State<_PodcastPreviewScreen> {
),
child: Text(
epTitle,
- style: tt.bodySmall?.copyWith(color: Colors.white54),
+ style: tt.bodySmall?.copyWith(color: cs.onSurface.withValues(alpha: 0.54)),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
@@ -600,7 +600,7 @@ class _PodcastPreviewScreenState extends State<_PodcastPreviewScreen> {
padding: const EdgeInsets.only(top: 4),
child: Text(
'+ ${_feedEpisodes.length - 5} more episodes',
- style: tt.labelSmall?.copyWith(color: Colors.white24),
+ style: tt.labelSmall?.copyWith(color: cs.onSurface.withValues(alpha: 0.24)),
textAlign: TextAlign.center,
),
),
@@ -618,7 +618,7 @@ class _PodcastPreviewScreenState extends State<_PodcastPreviewScreen> {
child: FilledButton.icon(
onPressed: _adding ? null : _addPodcast,
icon: _adding
- ? const SizedBox(width: 18, height: 18, child: CircularProgressIndicator(strokeWidth: 2, color: Colors.white))
+ ? SizedBox(width: 18, height: 18, child: CircularProgressIndicator(strokeWidth: 2, color: cs.onSurface))
: const Icon(Icons.add_rounded),
label: Text(_adding ? 'Adding…' : 'Add to Library', style: const TextStyle(fontWeight: FontWeight.w700)),
style: FilledButton.styleFrom(
@@ -783,7 +783,7 @@ class _PodcastDetailScreenState extends State<_PodcastDetailScreen> with SingleT
// Back button
Padding(padding: const EdgeInsets.fromLTRB(4, 4, 8, 0),
child: Row(children: [
- IconButton(icon: const Icon(Icons.arrow_back_rounded, color: Colors.white54), onPressed: () => Navigator.pop(context)),
+ IconButton(icon: Icon(Icons.arrow_back_rounded, color: cs.onSurface.withValues(alpha: 0.54)), onPressed: () => Navigator.pop(context)),
const Spacer(),
])),
@@ -798,9 +798,9 @@ class _PodcastDetailScreenState extends State<_PodcastDetailScreen> with SingleT
child: Icon(Icons.podcasts_rounded, color: cs.primary.withValues(alpha: 0.4), size: 28)))),
const SizedBox(width: 14),
Expanded(child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
- Text(_title, style: tt.titleMedium?.copyWith(fontWeight: FontWeight.w700, color: Colors.white), maxLines: 2, overflow: TextOverflow.ellipsis),
+ Text(_title, style: tt.titleMedium?.copyWith(fontWeight: FontWeight.w700, color: cs.onSurface), maxLines: 2, overflow: TextOverflow.ellipsis),
if (author.isNotEmpty) ...[const SizedBox(height: 2),
- Text(author, style: tt.bodySmall?.copyWith(color: Colors.white38))],
+ Text(author, style: tt.bodySmall?.copyWith(color: cs.onSurfaceVariant.withValues(alpha: 0.6)))],
const SizedBox(height: 6),
Text('${_episodes.length} downloaded', style: tt.labelSmall?.copyWith(color: cs.primary.withValues(alpha: 0.7), fontSize: 11)),
])),
@@ -810,10 +810,10 @@ class _PodcastDetailScreenState extends State<_PodcastDetailScreen> with SingleT
TabBar(
controller: _tabCtrl,
labelColor: cs.primary,
- unselectedLabelColor: Colors.white.withValues(alpha: 0.3),
+ unselectedLabelColor: cs.onSurface.withValues(alpha: 0.3),
indicatorColor: cs.primary,
indicatorSize: TabBarIndicatorSize.label,
- dividerColor: Colors.white.withValues(alpha: 0.06),
+ dividerColor: cs.onSurface.withValues(alpha: 0.06),
tabs: const [Tab(text: 'Downloaded'), Tab(text: 'Feed')],
onTap: (i) { if (i == 1 && _feedEpisodes.isEmpty && !_loadingFeed) _loadFeed(); },
),
@@ -839,9 +839,9 @@ class _PodcastDetailScreenState extends State<_PodcastDetailScreen> with SingleT
if (_episodes.isEmpty && queueItems.isEmpty) {
return Center(child: Column(mainAxisSize: MainAxisSize.min, children: [
- Icon(Icons.download_done_rounded, size: 40, color: Colors.white.withValues(alpha: 0.1)),
+ Icon(Icons.download_done_rounded, size: 40, color: cs.onSurface.withValues(alpha: 0.1)),
const SizedBox(height: 8),
- Text('No downloaded episodes', style: tt.bodyMedium?.copyWith(color: Colors.white.withValues(alpha: 0.3))),
+ Text('No downloaded episodes', style: tt.bodyMedium?.copyWith(color: cs.onSurface.withValues(alpha: 0.3))),
const SizedBox(height: 8),
GestureDetector(
onTap: () { _tabCtrl.animateTo(1); if (_feedEpisodes.isEmpty && !_loadingFeed) _loadFeed(); },
@@ -878,7 +878,7 @@ class _PodcastDetailScreenState extends State<_PodcastDetailScreen> with SingleT
: Icon(Icons.hourglass_top_rounded, size: 16, color: cs.primary.withValues(alpha: 0.5))),
const SizedBox(width: 12),
Expanded(child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
- Text(title, style: tt.bodySmall?.copyWith(fontWeight: FontWeight.w600, color: Colors.white),
+ Text(title, style: tt.bodySmall?.copyWith(fontWeight: FontWeight.w600, color: cs.onSurface),
maxLines: 2, overflow: TextOverflow.ellipsis),
const SizedBox(height: 2),
Text(isActive ? 'Downloading...' : 'Queued',
@@ -904,16 +904,16 @@ class _PodcastDetailScreenState extends State<_PodcastDetailScreen> with SingleT
decoration: BoxDecoration(color: cs.surfaceContainerHigh, borderRadius: BorderRadius.circular(12)),
child: Row(children: [
Expanded(child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
- Text(epTitle, style: tt.bodySmall?.copyWith(fontWeight: FontWeight.w600, color: Colors.white), maxLines: 2, overflow: TextOverflow.ellipsis),
+ Text(epTitle, style: tt.bodySmall?.copyWith(fontWeight: FontWeight.w600, color: cs.onSurface), maxLines: 2, overflow: TextOverflow.ellipsis),
const SizedBox(height: 3),
Row(children: [
- if (pubAt != null) Text(_fmtDate(pubAt.toInt()), style: tt.labelSmall?.copyWith(color: Colors.white24, fontSize: 10)),
- if (pubAt != null && durStr.isNotEmpty) Text(' · ', style: tt.labelSmall?.copyWith(color: Colors.white.withValues(alpha: 0.15))),
- if (durStr.isNotEmpty) Text(durStr, style: tt.labelSmall?.copyWith(color: Colors.white24, fontSize: 10)),
+ if (pubAt != null) Text(_fmtDate(pubAt.toInt()), style: tt.labelSmall?.copyWith(color: cs.onSurface.withValues(alpha: 0.24), fontSize: 10)),
+ if (pubAt != null && durStr.isNotEmpty) Text(' · ', style: tt.labelSmall?.copyWith(color: cs.onSurface.withValues(alpha: 0.15))),
+ if (durStr.isNotEmpty) Text(durStr, style: tt.labelSmall?.copyWith(color: cs.onSurface.withValues(alpha: 0.24), fontSize: 10)),
]),
])),
const SizedBox(width: 8),
- Icon(Icons.chevron_right_rounded, size: 18, color: Colors.white.withValues(alpha: 0.15)),
+ Icon(Icons.chevron_right_rounded, size: 18, color: cs.onSurface.withValues(alpha: 0.15)),
]),
),
));
@@ -926,10 +926,10 @@ class _PodcastDetailScreenState extends State<_PodcastDetailScreen> with SingleT
Widget _buildFeedTab(ColorScheme cs, TextTheme tt) {
if (_loadingFeed) return const Center(child: CircularProgressIndicator(strokeWidth: 2));
- if (_feedUrl.isEmpty) return Center(child: Text('No feed URL available', style: tt.bodyMedium?.copyWith(color: Colors.white.withValues(alpha: 0.3))));
+ if (_feedUrl.isEmpty) return Center(child: Text('No feed URL available', style: tt.bodyMedium?.copyWith(color: cs.onSurface.withValues(alpha: 0.3))));
if (_feedEpisodes.isEmpty) {
return Center(child: Column(mainAxisSize: MainAxisSize.min, children: [
- Text('No episodes found', style: tt.bodyMedium?.copyWith(color: Colors.white.withValues(alpha: 0.3))),
+ Text('No episodes found', style: tt.bodyMedium?.copyWith(color: cs.onSurface.withValues(alpha: 0.3))),
const SizedBox(height: 8),
GestureDetector(onTap: _loadFeed,
child: Text('Retry', style: tt.bodySmall?.copyWith(color: cs.primary))),
@@ -957,13 +957,13 @@ class _PodcastDetailScreenState extends State<_PodcastDetailScreen> with SingleT
child: Row(children: [
Expanded(child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
Text(epTitle, style: tt.bodySmall?.copyWith(fontWeight: FontWeight.w600,
- color: already ? Colors.white38 : Colors.white), maxLines: 2, overflow: TextOverflow.ellipsis),
+ color: already ? cs.onSurfaceVariant.withValues(alpha: 0.6) : cs.onSurface), maxLines: 2, overflow: TextOverflow.ellipsis),
if (pubDate != null) ...[const SizedBox(height: 3),
- Text(_fmtDate(pubDate.toInt()), style: tt.labelSmall?.copyWith(color: Colors.white24, fontSize: 10))],
+ Text(_fmtDate(pubDate.toInt()), style: tt.labelSmall?.copyWith(color: cs.onSurface.withValues(alpha: 0.24), fontSize: 10))],
])),
const SizedBox(width: 8),
if (already) Icon(Icons.check_circle_rounded, size: 18, color: Colors.green.withValues(alpha: 0.5))
- else Icon(Icons.chevron_right_rounded, size: 18, color: Colors.white.withValues(alpha: 0.15)),
+ else Icon(Icons.chevron_right_rounded, size: 18, color: cs.onSurface.withValues(alpha: 0.15)),
]),
),
));
@@ -1080,12 +1080,12 @@ class _EpisodeDetailSheet extends StatelessWidget {
child: Column(mainAxisSize: MainAxisSize.min, children: [
// Handle
Center(child: Container(margin: const EdgeInsets.only(top: 12), width: 36, height: 4,
- decoration: BoxDecoration(color: Colors.white12, borderRadius: BorderRadius.circular(2)))),
+ decoration: BoxDecoration(color: cs.onSurface.withValues(alpha: 0.12), borderRadius: BorderRadius.circular(2)))),
// Title
Padding(padding: const EdgeInsets.fromLTRB(20, 16, 20, 0),
child: Align(alignment: Alignment.centerLeft,
- child: Text(title, style: tt.titleSmall?.copyWith(fontWeight: FontWeight.w700, color: Colors.white),
+ child: Text(title, style: tt.titleSmall?.copyWith(fontWeight: FontWeight.w700, color: cs.onSurface),
maxLines: 3, overflow: TextOverflow.ellipsis))),
// Info chips
@@ -1094,15 +1094,15 @@ class _EpisodeDetailSheet extends StatelessWidget {
child: Align(alignment: Alignment.centerLeft,
child: Wrap(spacing: 8, runSpacing: 6, children: chips.map((c) => Container(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
- decoration: BoxDecoration(color: Colors.white.withValues(alpha: 0.06), borderRadius: BorderRadius.circular(6)),
- child: Text(c, style: tt.labelSmall?.copyWith(color: Colors.white54, fontSize: 11)),
+ decoration: BoxDecoration(color: cs.onSurface.withValues(alpha: 0.06), borderRadius: BorderRadius.circular(6)),
+ child: Text(c, style: tt.labelSmall?.copyWith(color: cs.onSurface.withValues(alpha: 0.54), fontSize: 11)),
)).toList()))),
// File type
if (fileType.isNotEmpty)
Padding(padding: const EdgeInsets.fromLTRB(20, 8, 20, 0),
child: Align(alignment: Alignment.centerLeft,
- child: Text(fileType, style: tt.labelSmall?.copyWith(color: Colors.white24, fontSize: 10)))),
+ child: Text(fileType, style: tt.labelSmall?.copyWith(color: cs.onSurface.withValues(alpha: 0.24), fontSize: 10)))),
// Description
if (description.isNotEmpty)
@@ -1110,7 +1110,7 @@ class _EpisodeDetailSheet extends StatelessWidget {
child: Padding(padding: const EdgeInsets.fromLTRB(20, 12, 20, 0),
child: SingleChildScrollView(
child: SizedBox(width: double.infinity,
- child: Text(description, style: tt.bodySmall?.copyWith(color: Colors.white54, height: 1.5))),
+ child: Text(description, style: tt.bodySmall?.copyWith(color: cs.onSurface.withValues(alpha: 0.54), height: 1.5))),
)),
),
@@ -1121,11 +1121,11 @@ class _EpisodeDetailSheet extends StatelessWidget {
child: OutlinedButton(
onPressed: () => Navigator.pop(context),
style: OutlinedButton.styleFrom(
- side: BorderSide(color: Colors.white.withValues(alpha: 0.1)),
+ side: BorderSide(color: cs.onSurface.withValues(alpha: 0.1)),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14)),
padding: const EdgeInsets.symmetric(vertical: 14),
),
- child: const Text('Back', style: TextStyle(color: Colors.white54, fontWeight: FontWeight.w600)),
+ child: Text('Back', style: TextStyle(color: cs.onSurface.withValues(alpha: 0.54), fontWeight: FontWeight.w600)),
),
),
const SizedBox(width: 12),
@@ -1138,8 +1138,8 @@ class _EpisodeDetailSheet extends StatelessWidget {
style: FilledButton.styleFrom(
backgroundColor: alreadyDownloaded ? Colors.green.withValues(alpha: 0.15) : cs.primary,
foregroundColor: alreadyDownloaded ? Colors.green : cs.onPrimary,
- disabledBackgroundColor: alreadyDownloaded ? Colors.green.withValues(alpha: 0.15) : Colors.white.withValues(alpha: 0.06),
- disabledForegroundColor: alreadyDownloaded ? Colors.green : Colors.white38,
+ disabledBackgroundColor: alreadyDownloaded ? Colors.green.withValues(alpha: 0.15) : cs.onSurface.withValues(alpha: 0.06),
+ disabledForegroundColor: alreadyDownloaded ? Colors.green : cs.onSurfaceVariant.withValues(alpha: 0.6),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14)),
padding: const EdgeInsets.symmetric(vertical: 14),
),
@@ -1233,11 +1233,11 @@ class _DownloadedEpisodeDetailSheet extends StatelessWidget {
decoration: BoxDecoration(color: Theme.of(context).bottomSheetTheme.backgroundColor, borderRadius: const BorderRadius.vertical(top: Radius.circular(24))),
child: Column(mainAxisSize: MainAxisSize.min, children: [
Center(child: Container(margin: const EdgeInsets.only(top: 12), width: 36, height: 4,
- decoration: BoxDecoration(color: Colors.white12, borderRadius: BorderRadius.circular(2)))),
+ decoration: BoxDecoration(color: cs.onSurface.withValues(alpha: 0.12), borderRadius: BorderRadius.circular(2)))),
Padding(padding: const EdgeInsets.fromLTRB(20, 16, 20, 0),
child: Align(alignment: Alignment.centerLeft,
- child: Text(title, style: tt.titleSmall?.copyWith(fontWeight: FontWeight.w700, color: Colors.white),
+ child: Text(title, style: tt.titleSmall?.copyWith(fontWeight: FontWeight.w700, color: cs.onSurface),
maxLines: 3, overflow: TextOverflow.ellipsis))),
if (chips.isNotEmpty)
@@ -1245,8 +1245,8 @@ class _DownloadedEpisodeDetailSheet extends StatelessWidget {
child: Align(alignment: Alignment.centerLeft,
child: Wrap(spacing: 8, runSpacing: 6, children: chips.map((c) => Container(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
- decoration: BoxDecoration(color: Colors.white.withValues(alpha: 0.06), borderRadius: BorderRadius.circular(6)),
- child: Text(c, style: tt.labelSmall?.copyWith(color: Colors.white54, fontSize: 11)),
+ decoration: BoxDecoration(color: cs.onSurface.withValues(alpha: 0.06), borderRadius: BorderRadius.circular(6)),
+ child: Text(c, style: tt.labelSmall?.copyWith(color: cs.onSurface.withValues(alpha: 0.54), fontSize: 11)),
)).toList()))),
if (description.isNotEmpty)
@@ -1254,7 +1254,7 @@ class _DownloadedEpisodeDetailSheet extends StatelessWidget {
child: Padding(padding: const EdgeInsets.fromLTRB(20, 12, 20, 0),
child: SingleChildScrollView(
child: SizedBox(width: double.infinity,
- child: Text(description, style: tt.bodySmall?.copyWith(color: Colors.white54, height: 1.5))),
+ child: Text(description, style: tt.bodySmall?.copyWith(color: cs.onSurface.withValues(alpha: 0.54), height: 1.5))),
)),
),
@@ -1264,11 +1264,11 @@ class _DownloadedEpisodeDetailSheet extends StatelessWidget {
child: OutlinedButton(
onPressed: () => Navigator.pop(context),
style: OutlinedButton.styleFrom(
- side: BorderSide(color: Colors.white.withValues(alpha: 0.1)),
+ side: BorderSide(color: cs.onSurface.withValues(alpha: 0.1)),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14)),
padding: const EdgeInsets.symmetric(vertical: 14),
),
- child: const Text('Back', style: TextStyle(color: Colors.white54, fontWeight: FontWeight.w600)),
+ child: Text('Back', style: TextStyle(color: cs.onSurface.withValues(alpha: 0.54), fontWeight: FontWeight.w600)),
),
),
const SizedBox(width: 12),
@@ -1276,7 +1276,7 @@ class _DownloadedEpisodeDetailSheet extends StatelessWidget {
child: FilledButton.icon(
onPressed: isDeleting ? null : onDelete,
icon: isDeleting
- ? const SizedBox(width: 16, height: 16, child: CircularProgressIndicator(strokeWidth: 1.5, color: Colors.white54))
+ ? SizedBox(width: 16, height: 16, child: CircularProgressIndicator(strokeWidth: 1.5, color: cs.onSurface.withValues(alpha: 0.54)))
: const Icon(Icons.delete_outline_rounded, size: 18),
label: Text(isDeleting ? 'Deleting...' : 'Delete Episode',
style: const TextStyle(fontWeight: FontWeight.w700)),
diff --git a/lib/screens/admin_screen.dart b/lib/screens/admin_screen.dart
index 5d7968c8..6aaf95e4 100644
--- a/lib/screens/admin_screen.dart
+++ b/lib/screens/admin_screen.dart
@@ -82,13 +82,13 @@ class _AdminScreenState extends State<AdminScreen> {
padding: const EdgeInsets.fromLTRB(20, 12, 8, 0),
child: Row(children: [
const Expanded(child: AbsorbPageHeader(title: 'Server Admin', padding: EdgeInsets.zero)),
- IconButton(icon: const Icon(Icons.close_rounded, color: Colors.white38), onPressed: () => Navigator.pop(context)),
+ IconButton(icon: Icon(Icons.close_rounded, color: cs.onSurfaceVariant), onPressed: () => Navigator.pop(context)),
]),
),
const SizedBox(height: 20),
// ── Server Overview ──
- _section(tt, 'Server'),
+ _section(cs, tt, 'Server'),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Container(
@@ -114,7 +114,7 @@ class _AdminScreenState extends State<AdminScreen> {
const SizedBox(height: 28),
// ── Manage Buttons ──
- _section(tt, 'Manage'),
+ _section(cs, tt, 'Manage'),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Column(children: [
@@ -148,13 +148,13 @@ class _AdminScreenState extends State<AdminScreen> {
// ── Active Sessions ──
if (_activeSessions.isNotEmpty) ...[
- _section(tt, 'Listening Now'),
+ _section(cs, tt, 'Listening Now'),
..._activeSessions.map((s) => _sessionCard(cs, tt, s)),
const SizedBox(height: 18),
],
// ── Libraries ──
- _section(tt, 'Libraries'),
+ _section(cs, tt, 'Libraries'),
..._libraries.map((lib) => _libraryCard(cs, tt, lib)),
],
),
@@ -165,16 +165,16 @@ class _AdminScreenState extends State<AdminScreen> {
// ─── Shared Widgets ─────────────────────────────────────────
- Widget _section(TextTheme tt, String t) => Padding(
+ Widget _section(ColorScheme cs, TextTheme tt, String t) => Padding(
padding: const EdgeInsets.fromLTRB(20, 0, 20, 10),
- child: Text(t, style: tt.labelLarge?.copyWith(color: Colors.white38, fontWeight: FontWeight.w600, letterSpacing: 0.5)));
+ child: Text(t, style: tt.labelLarge?.copyWith(color: cs.onSurfaceVariant.withValues(alpha: 0.6), fontWeight: FontWeight.w600, letterSpacing: 0.5)));
BoxDecoration _cardDeco(ColorScheme cs) => BoxDecoration(color: cs.surfaceContainerHigh, borderRadius: BorderRadius.circular(16));
Widget _stat(TextTheme tt, ColorScheme cs, IconData ic, String v, String l) => Expanded(child: Column(children: [
Icon(ic, size: 18, color: cs.primary.withValues(alpha: 0.6)), const SizedBox(height: 6),
- Text(v, style: tt.titleMedium?.copyWith(fontWeight: FontWeight.w700, color: Colors.white)), const SizedBox(height: 2),
- Text(l, style: tt.labelSmall?.copyWith(color: Colors.white38, fontSize: 10)),
+ Text(v, style: tt.titleMedium?.copyWith(fontWeight: FontWeight.w700, color: cs.onSurface)), const SizedBox(height: 2),
+ Text(l, style: tt.labelSmall?.copyWith(color: cs.onSurfaceVariant.withValues(alpha: 0.6), fontSize: 10)),
]));
Widget _actionBtn(ColorScheme cs, TextTheme tt, IconData ic, String l, bool loading, VoidCallback onTap) =>
@@ -182,10 +182,10 @@ class _AdminScreenState extends State<AdminScreen> {
padding: const EdgeInsets.symmetric(vertical: 12),
decoration: BoxDecoration(color: cs.surfaceContainerHigh, borderRadius: BorderRadius.circular(14)),
child: Row(mainAxisAlignment: MainAxisAlignment.center, children: [
- if (loading) const SizedBox(width: 16, height: 16, child: CircularProgressIndicator(strokeWidth: 1.5, color: Colors.white38))
+ if (loading) SizedBox(width: 16, height: 16, child: CircularProgressIndicator(strokeWidth: 1.5, color: cs.onSurfaceVariant.withValues(alpha: 0.5)))
else Icon(ic, size: 16, color: cs.primary),
const SizedBox(width: 8),
- Text(l, style: tt.labelMedium?.copyWith(color: loading ? Colors.white24 : Colors.white70, fontWeight: FontWeight.w600)),
+ Text(l, style: tt.labelMedium?.copyWith(color: loading ? cs.onSurface.withValues(alpha: 0.24) : cs.onSurface.withValues(alpha: 0.7), fontWeight: FontWeight.w600)),
])));
Widget _navButton(ColorScheme cs, TextTheme tt, {required IconData icon, required String label, required String subtitle, required VoidCallback onTap}) =>
@@ -195,10 +195,10 @@ class _AdminScreenState extends State<AdminScreen> {
child: Row(children: [
Icon(icon, color: cs.primary, size: 22), const SizedBox(width: 14),
Expanded(child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
- Text(label, style: tt.titleSmall?.copyWith(fontWeight: FontWeight.w600, color: Colors.white)),
- Text(subtitle, style: tt.bodySmall?.copyWith(color: Colors.white38)),
+ Text(label, style: tt.titleSmall?.copyWith(fontWeight: FontWeight.w600, color: cs.onSurface)),
+ Text(subtitle, style: tt.bodySmall?.copyWith(color: cs.onSurfaceVariant.withValues(alpha: 0.6))),
])),
- Icon(Icons.chevron_right_rounded, color: Colors.white.withValues(alpha: 0.15)),
+ Icon(Icons.chevron_right_rounded, color: cs.onSurface.withValues(alpha: 0.15)),
])));
// ─── Library Card ───────────────────────────────────────────
@@ -222,17 +222,17 @@ class _AdminScreenState extends State<AdminScreen> {
Row(children: [
Icon(mediaType == 'podcast' ? Icons.podcasts_rounded : Icons.auto_stories_rounded, size: 20, color: cs.primary),
const SizedBox(width: 10),
- Expanded(child: Text(name, style: tt.titleSmall?.copyWith(fontWeight: FontWeight.w700, color: Colors.white))),
+ Expanded(child: Text(name, style: tt.titleSmall?.copyWith(fontWeight: FontWeight.w700, color: cs.onSurface))),
Container(padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 3),
decoration: BoxDecoration(color: cs.primary.withValues(alpha: 0.1), borderRadius: BorderRadius.circular(8)),
child: Text(mediaType, style: tt.labelSmall?.copyWith(color: cs.primary, fontSize: 10, fontWeight: FontWeight.w600))),
]),
const SizedBox(height: 12),
Row(children: [
- _mini(tt, '$totalItems', mediaType == 'podcast' ? 'shows' : 'books'),
- if (folders > 0) _mini(tt, '$folders', 'folders'),
- if (totalSize != null) _mini(tt, _fmtB(totalSize.toInt()), 'size'),
- if (totalDur != null) _mini(tt, _fmtD(totalDur.toDouble()), 'duration'),
+ _mini(cs, tt, '$totalItems', mediaType == 'podcast' ? 'shows' : 'books'),
+ if (folders > 0) _mini(cs, tt, '$folders', 'folders'),
+ if (totalSize != null) _mini(cs, tt, _fmtB(totalSize.toInt()), 'size'),
+ if (totalDur != null) _mini(cs, tt, _fmtD(totalDur.toDouble()), 'duration'),
]),
const SizedBox(height: 12),
Row(children: [
@@ -243,22 +243,22 @@ class _AdminScreenState extends State<AdminScreen> {
])));
}
- Widget _mini(TextTheme tt, String v, String l) => Padding(padding: const EdgeInsets.only(right: 20), child: Column(
+ Widget _mini(ColorScheme cs, TextTheme tt, String v, String l) => Padding(padding: const EdgeInsets.only(right: 20), child: Column(
crossAxisAlignment: CrossAxisAlignment.start, children: [
- Text(v, style: tt.bodyMedium?.copyWith(fontWeight: FontWeight.w700, color: Colors.white, fontSize: 13)),
- Text(l, style: tt.labelSmall?.copyWith(color: Colors.white30, fontSize: 10)),
+ Text(v, style: tt.bodyMedium?.copyWith(fontWeight: FontWeight.w700, color: cs.onSurface, fontSize: 13)),
+ Text(l, style: tt.labelSmall?.copyWith(color: cs.onSurfaceVariant.withValues(alpha: 0.4), fontSize: 10)),
]));
Widget _libAct(ColorScheme cs, TextTheme tt, IconData ic, String l, bool loading, VoidCallback onTap) =>
GestureDetector(onTap: loading ? null : onTap, child: Container(
padding: const EdgeInsets.symmetric(vertical: 8),
- decoration: BoxDecoration(color: Colors.white.withValues(alpha: 0.04), borderRadius: BorderRadius.circular(10),
- border: Border.all(color: Colors.white.withValues(alpha: 0.06))),
+ decoration: BoxDecoration(color: cs.onSurface.withValues(alpha: 0.04), borderRadius: BorderRadius.circular(10),
+ border: Border.all(color: cs.onSurface.withValues(alpha: 0.06))),
child: Row(mainAxisAlignment: MainAxisAlignment.center, children: [
- if (loading) const SizedBox(width: 14, height: 14, child: CircularProgressIndicator(strokeWidth: 1.5, color: Colors.white38))
+ if (loading) SizedBox(width: 14, height: 14, child: CircularProgressIndicator(strokeWidth: 1.5, color: cs.onSurfaceVariant.withValues(alpha: 0.5)))
else Icon(ic, size: 14, color: cs.primary.withValues(alpha: 0.7)),
const SizedBox(width: 6),
- Text(l, style: tt.labelSmall?.copyWith(color: loading ? Colors.white24 : Colors.white54, fontWeight: FontWeight.w600, fontSize: 11)),
+ Text(l, style: tt.labelSmall?.copyWith(color: loading ? cs.onSurface.withValues(alpha: 0.24) : cs.onSurface.withValues(alpha: 0.54), fontWeight: FontWeight.w600, fontSize: 11)),
])));
Widget _sessionCard(ColorScheme cs, TextTheme tt, dynamic session) {
@@ -278,27 +278,27 @@ class _AdminScreenState extends State<AdminScreen> {
child: Row(children: [
Container(width: 8, height: 8, decoration: BoxDecoration(
shape: BoxShape.circle,
- color: isActive ? const Color(0xFF4CAF50) : Colors.white24,
+ color: isActive ? const Color(0xFF4CAF50) : cs.onSurface.withValues(alpha: 0.24),
)),
const SizedBox(width: 12),
Expanded(child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
- Text(displayTitle, style: tt.bodySmall?.copyWith(color: Colors.white, fontWeight: FontWeight.w600),
+ Text(displayTitle, style: tt.bodySmall?.copyWith(color: cs.onSurface, fontWeight: FontWeight.w600),
maxLines: 1, overflow: TextOverflow.ellipsis),
const SizedBox(height: 2),
Text(
[if (userName.isNotEmpty) userName, if (displayAuthor.isNotEmpty) displayAuthor].join(' · '),
- style: tt.labelSmall?.copyWith(color: Colors.white38, fontSize: 10),
+ style: tt.labelSmall?.copyWith(color: cs.onSurfaceVariant.withValues(alpha: 0.5), fontSize: 10),
maxLines: 1, overflow: TextOverflow.ellipsis,
),
const SizedBox(height: 6),
ClipRRect(borderRadius: BorderRadius.circular(2),
child: LinearProgressIndicator(value: progress.toDouble(),
- minHeight: 2, backgroundColor: Colors.white.withValues(alpha: 0.06),
- valueColor: AlwaysStoppedAnimation(isActive ? cs.primary : Colors.white24))),
+ minHeight: 2, backgroundColor: cs.onSurface.withValues(alpha: 0.06),
+ valueColor: AlwaysStoppedAnimation(isActive ? cs.primary : cs.onSurface.withValues(alpha: 0.24)))),
])),
const SizedBox(width: 12),
Text('${_fmtD(currentTime.toDouble())} / ${_fmtD(duration.toDouble())}',
- style: tt.labelSmall?.copyWith(color: Colors.white24, fontSize: 9)),
+ style: tt.labelSmall?.copyWith(color: cs.onSurface.withValues(alpha: 0.24), fontSize: 9)),
])),
);
}
diff --git a/lib/screens/admin_users_screen.dart b/lib/screens/admin_users_screen.dart
index 66fdba5e..33aa0349 100644
--- a/lib/screens/admin_users_screen.dart
+++ b/lib/screens/admin_users_screen.dart
@@ -43,7 +43,7 @@ class _AdminUsersScreenState extends State<AdminUsersScreen> {
padding: const EdgeInsets.fromLTRB(20, 12, 8, 0),
child: Row(children: [
const Expanded(child: AbsorbPageHeader(title: 'Users', padding: EdgeInsets.zero)),
- IconButton(icon: const Icon(Icons.close_rounded, color: Colors.white38), onPressed: () => Navigator.pop(context)),
+ IconButton(icon: Icon(Icons.close_rounded, color: cs.onSurfaceVariant), onPressed: () => Navigator.pop(context)),
]),
),
const SizedBox(height: 16),
@@ -90,7 +90,7 @@ class _AdminUsersScreenState extends State<AdminUsersScreen> {
],
Expanded(child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
Row(children: [
- Flexible(child: Text(username, style: tt.bodyMedium?.copyWith(fontWeight: FontWeight.w600, color: Colors.white), overflow: TextOverflow.ellipsis)),
+ Flexible(child: Text(username, style: tt.bodyMedium?.copyWith(fontWeight: FontWeight.w600, color: cs.onSurface), overflow: TextOverflow.ellipsis)),
const SizedBox(width: 6),
if (type == 'root') Container(
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 1),
@@ -111,7 +111,7 @@ class _AdminUsersScreenState extends State<AdminUsersScreen> {
Text('Disabled', style: tt.labelSmall?.copyWith(color: Colors.red.withValues(alpha: 0.5), fontSize: 10)),
],
])),
- Icon(Icons.chevron_right_rounded, size: 18, color: Colors.white.withValues(alpha: 0.15)),
+ Icon(Icons.chevron_right_rounded, size: 18, color: cs.onSurface.withValues(alpha: 0.15)),
]),
),
),
@@ -250,7 +250,7 @@ class _UserDetailScreenState extends State<_UserDetailScreen> {
tooltip: 'Edit user',
onPressed: _showEditor,
),
- IconButton(icon: const Icon(Icons.close_rounded, color: Colors.white38), onPressed: () => Navigator.pop(context)),
+ IconButton(icon: Icon(Icons.close_rounded, color: cs.onSurfaceVariant), onPressed: () => Navigator.pop(context)),
]),
),
// Online / last seen
@@ -259,13 +259,13 @@ class _UserDetailScreenState extends State<_UserDetailScreen> {
child: Row(children: [
Container(width: 8, height: 8, decoration: BoxDecoration(
shape: BoxShape.circle,
- color: _isOnline ? const Color(0xFF4CAF50) : Colors.white24,
+ color: _isOnline ? const Color(0xFF4CAF50) : cs.onSurface.withValues(alpha: 0.24),
)),
const SizedBox(width: 8),
Text(
_isOnline ? 'Online now' : 'Last seen $_lastSeenStr',
style: tt.labelSmall?.copyWith(
- color: _isOnline ? const Color(0xFF4CAF50).withValues(alpha: 0.8) : Colors.white.withValues(alpha: 0.3),
+ color: _isOnline ? const Color(0xFF4CAF50).withValues(alpha: 0.8) : cs.onSurface.withValues(alpha: 0.3),
fontSize: 11,
),
),
@@ -284,11 +284,11 @@ class _UserDetailScreenState extends State<_UserDetailScreen> {
Padding(
padding: const EdgeInsets.fromLTRB(20, 8, 20, 12),
child: Row(children: [
- _summaryChip(tt, '$inProgress', 'In Progress', cs.primary),
+ _summaryChip(cs, tt, '$inProgress', 'In Progress', cs.primary),
const SizedBox(width: 10),
- _summaryChip(tt, '$finished', 'Finished', Colors.green),
+ _summaryChip(cs, tt, '$finished', 'Finished', Colors.green),
const SizedBox(width: 10),
- _summaryChip(tt, '${_progressItems.length}', 'Total', Colors.white38),
+ _summaryChip(cs, tt, '${_progressItems.length}', 'Total', cs.onSurfaceVariant),
]),
),
Expanded(
@@ -299,9 +299,9 @@ class _UserDetailScreenState extends State<_UserDetailScreen> {
child: _progressItems.isEmpty
? ListView(children: [
const SizedBox(height: 80),
- Center(child: Icon(Icons.menu_book_rounded, size: 48, color: Colors.white.withValues(alpha: 0.08))),
+ Center(child: Icon(Icons.menu_book_rounded, size: 48, color: cs.onSurface.withValues(alpha: 0.08))),
const SizedBox(height: 12),
- Center(child: Text('No reading activity', style: tt.bodyMedium?.copyWith(color: Colors.white24))),
+ Center(child: Text('No reading activity', style: tt.bodyMedium?.copyWith(color: cs.onSurface.withValues(alpha: 0.24)))),
])
: ListView.builder(
padding: const EdgeInsets.only(bottom: 40),
@@ -315,15 +315,15 @@ class _UserDetailScreenState extends State<_UserDetailScreen> {
);
}
- Widget _summaryChip(TextTheme tt, String value, String label, Color color) {
+ Widget _summaryChip(ColorScheme cs, TextTheme tt, String value, String label, Color color) {
return Expanded(
child: Container(
padding: const EdgeInsets.symmetric(vertical: 10),
decoration: BoxDecoration(color: color.withValues(alpha: 0.08), borderRadius: BorderRadius.circular(12)),
child: Column(children: [
- Text(value, style: tt.titleMedium?.copyWith(fontWeight: FontWeight.w700, color: color == Colors.white38 ? Colors.white54 : color)),
+ Text(value, style: tt.titleMedium?.copyWith(fontWeight: FontWeight.w700, color: color)),
const SizedBox(height: 2),
- Text(label, style: tt.labelSmall?.copyWith(color: Colors.white.withValues(alpha: 0.3), fontSize: 10)),
+ Text(label, style: tt.labelSmall?.copyWith(color: cs.onSurface.withValues(alpha: 0.3), fontSize: 10)),
]),
),
);
@@ -381,11 +381,11 @@ class _UserDetailScreenState extends State<_UserDetailScreen> {
),
const SizedBox(width: 12),
Expanded(child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
- Text(displayTitle, style: tt.bodySmall?.copyWith(color: Colors.white, fontWeight: FontWeight.w600),
+ Text(displayTitle, style: tt.bodySmall?.copyWith(color: cs.onSurface, fontWeight: FontWeight.w600),
maxLines: 1, overflow: TextOverflow.ellipsis),
if (subtitle.isNotEmpty) ...[
const SizedBox(height: 1),
- Text(subtitle, style: tt.labelSmall?.copyWith(color: Colors.white.withValues(alpha: 0.3), fontSize: 10),
+ Text(subtitle, style: tt.labelSmall?.copyWith(color: cs.onSurface.withValues(alpha: 0.3), fontSize: 10),
maxLines: 1, overflow: TextOverflow.ellipsis),
],
const SizedBox(height: 6),
@@ -396,7 +396,7 @@ class _UserDetailScreenState extends State<_UserDetailScreen> {
child: LinearProgressIndicator(
value: progressVal.clamp(0.0, 1.0),
minHeight: 3,
- backgroundColor: Colors.white.withValues(alpha: 0.06),
+ backgroundColor: cs.onSurface.withValues(alpha: 0.06),
valueColor: AlwaysStoppedAnimation(
isFinished ? Colors.green : cs.primary.withValues(alpha: 0.8)),
),
@@ -405,16 +405,16 @@ class _UserDetailScreenState extends State<_UserDetailScreen> {
const SizedBox(width: 10),
Text(isFinished ? 'Finished' : '$percent%',
style: tt.labelSmall?.copyWith(
- color: isFinished ? Colors.green.withValues(alpha: 0.8) : Colors.white38,
+ color: isFinished ? Colors.green.withValues(alpha: 0.8) : cs.onSurfaceVariant.withValues(alpha: 0.6),
fontWeight: FontWeight.w600, fontSize: 10)),
]),
const SizedBox(height: 3),
Row(children: [
Text('${_fmtDur(currentTime.toDouble())} / ${_fmtDur(duration.toDouble())}',
- style: tt.labelSmall?.copyWith(color: Colors.white.withValues(alpha: 0.2), fontSize: 9)),
+ style: tt.labelSmall?.copyWith(color: cs.onSurface.withValues(alpha: 0.2), fontSize: 9)),
if (lastUpdateStr.isNotEmpty) ...[
const Spacer(),
- Text(lastUpdateStr, style: tt.labelSmall?.copyWith(color: Colors.white.withValues(alpha: 0.2), fontSize: 9)),
+ Text(lastUpdateStr, style: tt.labelSmall?.copyWith(color: cs.onSurface.withValues(alpha: 0.2), fontSize: 9)),
],
]),
])),
@@ -502,10 +502,10 @@ class _UserEditorSheetState extends State<_UserEditorSheet> {
decoration: BoxDecoration(color: Theme.of(context).bottomSheetTheme.backgroundColor, borderRadius: const BorderRadius.vertical(top: Radius.circular(24))),
child: Column(mainAxisSize: MainAxisSize.min, children: [
Center(child: Container(margin: const EdgeInsets.only(top: 12), width: 36, height: 4,
- decoration: BoxDecoration(color: Colors.white12, borderRadius: BorderRadius.circular(2)))),
+ decoration: BoxDecoration(color: cs.onSurface.withValues(alpha: 0.12), borderRadius: BorderRadius.circular(2)))),
Padding(padding: const EdgeInsets.fromLTRB(20, 16, 12, 0),
child: Row(children: [
- Expanded(child: Text(_isNew ? 'New User' : 'Edit User', style: tt.titleMedium?.copyWith(fontWeight: FontWeight.w700, color: Colors.white))),
+ Expanded(child: Text(_isNew ? 'New User' : 'Edit User', style: tt.titleMedium?.copyWith(fontWeight: FontWeight.w700, color: cs.onSurface))),
if (!_isNew) IconButton(
icon: Icon(Icons.delete_outline_rounded, color: Colors.red.shade300, size: 20),
onPressed: _deleting ? null : _deleteUser),
@@ -513,34 +513,34 @@ class _UserEditorSheetState extends State<_UserEditorSheet> {
Flexible(child: SingleChildScrollView(
padding: const EdgeInsets.fromLTRB(20, 16, 20, 0),
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
- _lbl(tt, 'Username'), const SizedBox(height: 6),
- TextField(controller: _usernameCtrl, enabled: _isNew, style: const TextStyle(color: Colors.white),
+ _lbl(cs, tt, 'Username'), const SizedBox(height: 6),
+ TextField(controller: _usernameCtrl, enabled: _isNew, style: TextStyle(color: cs.onSurface),
decoration: _deco(cs, 'Enter username')),
const SizedBox(height: 16),
- _lbl(tt, _isNew ? 'Password' : 'New Password'), const SizedBox(height: 6),
- TextField(controller: _passwordCtrl, obscureText: true, style: const TextStyle(color: Colors.white),
+ _lbl(cs, tt, _isNew ? 'Password' : 'New Password'), const SizedBox(height: 6),
+ TextField(controller: _passwordCtrl, obscureText: true, style: TextStyle(color: cs.onSurface),
decoration: _deco(cs, _isNew ? 'Enter password' : 'Leave blank to keep current')),
const SizedBox(height: 20),
- _lbl(tt, 'Account Type'), const SizedBox(height: 8),
+ _lbl(cs, tt, 'Account Type'), const SizedBox(height: 8),
Row(children: [
_chip(cs, tt, 'guest', Icons.person_outline_rounded), const SizedBox(width: 8),
_chip(cs, tt, 'user', Icons.person_rounded), const SizedBox(width: 8),
_chip(cs, tt, 'admin', Icons.admin_panel_settings_rounded),
]),
const SizedBox(height: 20),
- _lbl(tt, 'Status'), const SizedBox(height: 4),
- _sw('Account Active', _isActive, (v) => setState(() => _isActive = v), sub: 'Disabled accounts cannot log in'),
- _sw('Locked', _isLocked, (v) => setState(() => _isLocked = v), sub: 'Prevents password changes'),
+ _lbl(cs, tt, 'Status'), const SizedBox(height: 4),
+ _sw(cs, 'Account Active', _isActive, (v) => setState(() => _isActive = v), sub: 'Disabled accounts cannot log in'),
+ _sw(cs, 'Locked', _isLocked, (v) => setState(() => _isLocked = v), sub: 'Prevents password changes'),
const SizedBox(height: 12),
- _lbl(tt, 'Permissions'), const SizedBox(height: 4),
- _sw('Download', _canDownload, (v) => setState(() => _canDownload = v)),
- _sw('Update', _canUpdate, (v) => setState(() => _canUpdate = v), sub: 'Edit metadata and library items'),
- _sw('Delete', _canDelete, (v) => setState(() => _canDelete = v)),
- _sw('Upload', _canUpload, (v) => setState(() => _canUpload = v)),
- _sw('Explicit Content', _accessExplicit, (v) => setState(() => _accessExplicit = v)),
+ _lbl(cs, tt, 'Permissions'), const SizedBox(height: 4),
+ _sw(cs, 'Download', _canDownload, (v) => setState(() => _canDownload = v)),
+ _sw(cs, 'Update', _canUpdate, (v) => setState(() => _canUpdate = v), sub: 'Edit metadata and library items'),
+ _sw(cs, 'Delete', _canDelete, (v) => setState(() => _canDelete = v)),
+ _sw(cs, 'Upload', _canUpload, (v) => setState(() => _canUpload = v)),
+ _sw(cs, 'Explicit Content', _accessExplicit, (v) => setState(() => _accessExplicit = v)),
const SizedBox(height: 12),
- _lbl(tt, 'Library Access'), const SizedBox(height: 4),
- _sw('Access All Libraries', _accessAllLibraries, (v) => setState(() => _accessAllLibraries = v)),
+ _lbl(cs, tt, 'Library Access'), const SizedBox(height: 4),
+ _sw(cs, 'Access All Libraries', _accessAllLibraries, (v) => setState(() => _accessAllLibraries = v)),
if (!_accessAllLibraries) ...[
const SizedBox(height: 8),
...widget.libraries.map((lib) {
@@ -552,13 +552,13 @@ class _UserEditorSheetState extends State<_UserEditorSheet> {
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 10),
decoration: BoxDecoration(
- color: sel ? cs.primary.withValues(alpha: 0.1) : Colors.white.withValues(alpha: 0.03),
+ color: sel ? cs.primary.withValues(alpha: 0.1) : cs.onSurface.withValues(alpha: 0.03),
borderRadius: BorderRadius.circular(10),
- border: Border.all(color: sel ? cs.primary.withValues(alpha: 0.3) : Colors.white.withValues(alpha: 0.06))),
+ border: Border.all(color: sel ? cs.primary.withValues(alpha: 0.3) : cs.onSurface.withValues(alpha: 0.06))),
child: Row(children: [
- Icon(sel ? Icons.check_circle_rounded : Icons.circle_outlined, size: 18, color: sel ? cs.primary : Colors.white24),
+ Icon(sel ? Icons.check_circle_rounded : Icons.circle_outlined, size: 18, color: sel ? cs.primary : cs.onSurface.withValues(alpha: 0.24)),
const SizedBox(width: 10),
- Text(name, style: TextStyle(color: sel ? Colors.white : Colors.white54, fontWeight: sel ? FontWeight.w600 : FontWeight.w400)),
+ Text(name, style: TextStyle(color: sel ? cs.onSurface : cs.onSurface.withValues(alpha: 0.54), fontWeight: sel ? FontWeight.w600 : FontWeight.w400)),
]),
),
));
@@ -570,21 +570,21 @@ class _UserEditorSheetState extends State<_UserEditorSheet> {
onPressed: _saving ? null : _save,
style: FilledButton.styleFrom(backgroundColor: cs.primary, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14))),
child: _saving
- ? const SizedBox(width: 20, height: 20, child: CircularProgressIndicator(strokeWidth: 2, color: Colors.white))
+ ? SizedBox(width: 20, height: 20, child: CircularProgressIndicator(strokeWidth: 2, color: cs.onPrimary))
: Text(_isNew ? 'Create User' : 'Save Changes', style: TextStyle(fontWeight: FontWeight.w700, color: cs.onPrimary)),
))),
]));
}
- Widget _lbl(TextTheme tt, String t) => Text(t, style: tt.labelMedium?.copyWith(color: Colors.white54, fontWeight: FontWeight.w600));
+ Widget _lbl(ColorScheme cs, TextTheme tt, String t) => Text(t, style: tt.labelMedium?.copyWith(color: cs.onSurface.withValues(alpha: 0.54), fontWeight: FontWeight.w600));
InputDecoration _deco(ColorScheme cs, String hint) => InputDecoration(
- hintText: hint, hintStyle: TextStyle(color: Colors.white.withValues(alpha: 0.2)),
- filled: true, fillColor: Colors.white.withValues(alpha: 0.04),
- border: OutlineInputBorder(borderRadius: BorderRadius.circular(12), borderSide: BorderSide(color: Colors.white.withValues(alpha: 0.08))),
- enabledBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(12), borderSide: BorderSide(color: Colors.white.withValues(alpha: 0.08))),
+ hintText: hint, hintStyle: TextStyle(color: cs.onSurface.withValues(alpha: 0.2)),
+ filled: true, fillColor: cs.onSurface.withValues(alpha: 0.04),
+ border: OutlineInputBorder(borderRadius: BorderRadius.circular(12), borderSide: BorderSide(color: cs.onSurface.withValues(alpha: 0.08))),
+ enabledBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(12), borderSide: BorderSide(color: cs.onSurface.withValues(alpha: 0.08))),
focusedBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(12), borderSide: BorderSide(color: cs.primary.withValues(alpha: 0.5))),
- disabledBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(12), borderSide: BorderSide(color: Colors.white.withValues(alpha: 0.04))),
+ disabledBorder: OutlineInputBorder(borderRadius: BorderRadius.circular(12), borderSide: BorderSide(color: cs.onSurface.withValues(alpha: 0.04))),
contentPadding: const EdgeInsets.symmetric(horizontal: 14, vertical: 12));
Widget _chip(ColorScheme cs, TextTheme tt, String type, IconData ic) {
@@ -592,19 +592,19 @@ class _UserEditorSheetState extends State<_UserEditorSheet> {
return Expanded(child: GestureDetector(onTap: () => setState(() => _type = type),
child: AnimatedContainer(duration: const Duration(milliseconds: 200), padding: const EdgeInsets.symmetric(vertical: 10),
decoration: BoxDecoration(
- color: on ? cs.primary.withValues(alpha: 0.15) : Colors.white.withValues(alpha: 0.03),
+ color: on ? cs.primary.withValues(alpha: 0.15) : cs.onSurface.withValues(alpha: 0.03),
borderRadius: BorderRadius.circular(12),
- border: Border.all(color: on ? cs.primary.withValues(alpha: 0.4) : Colors.white.withValues(alpha: 0.06))),
+ border: Border.all(color: on ? cs.primary.withValues(alpha: 0.4) : cs.onSurface.withValues(alpha: 0.06))),
child: Column(children: [
- Icon(ic, size: 20, color: on ? cs.primary : Colors.white.withValues(alpha: 0.3)), const SizedBox(height: 4),
+ Icon(ic, size: 20, color: on ? cs.primary : cs.onSurface.withValues(alpha: 0.3)), const SizedBox(height: 4),
Text(type[0].toUpperCase() + type.substring(1),
- style: tt.labelSmall?.copyWith(color: on ? cs.primary : Colors.white38, fontWeight: on ? FontWeight.w700 : FontWeight.w500, fontSize: 11)),
+ style: tt.labelSmall?.copyWith(color: on ? cs.primary : cs.onSurfaceVariant.withValues(alpha: 0.6), fontWeight: on ? FontWeight.w700 : FontWeight.w500, fontSize: 11)),
]))));
}
- Widget _sw(String l, bool v, ValueChanged<bool> cb, {String? sub}) => SwitchListTile(dense: true, contentPadding: EdgeInsets.zero,
- title: Text(l, style: const TextStyle(color: Colors.white, fontSize: 14)),
- subtitle: sub != null ? Text(sub, style: TextStyle(color: Colors.white.withValues(alpha: 0.3), fontSize: 11)) : null,
+ Widget _sw(ColorScheme cs, String l, bool v, ValueChanged<bool> cb, {String? sub}) => SwitchListTile(dense: true, contentPadding: EdgeInsets.zero,
+ title: Text(l, style: TextStyle(color: cs.onSurface, fontSize: 14)),
+ subtitle: sub != null ? Text(sub, style: TextStyle(color: cs.onSurface.withValues(alpha: 0.3), fontSize: 11)) : null,
value: v, onChanged: cb);
Future<void> _save() async {