diff --git a/lib/app/app_theme.dart b/lib/app/app_theme.dart index 95aa093..5fe814f 100644 --- a/lib/app/app_theme.dart +++ b/lib/app/app_theme.dart @@ -70,7 +70,7 @@ class GlassCard extends StatelessWidget { @override Widget build(BuildContext context) { final theme = ShadTheme.of(context); - final isDark = theme.brightness == Brightness.dark; + final cs = theme.colorScheme; return ClipRRect( borderRadius: BorderRadius.circular(borderRadius), child: BackdropFilter( @@ -78,16 +78,9 @@ class GlassCard extends StatelessWidget { child: Container( padding: padding ?? const EdgeInsets.all(16), decoration: BoxDecoration( - color: isDark - ? theme.colorScheme.card.withValues(alpha: 0.72) - : Colors.white.withValues(alpha: 0.15), + color: cs.card.withValues(alpha: 0.92), borderRadius: BorderRadius.circular(borderRadius), - border: Border.all( - color: isDark - ? theme.colorScheme.border.withValues(alpha: 0.82) - : Colors.white.withValues(alpha: 0.2), - width: 1, - ), + border: Border.all(color: cs.border, width: 1), ), child: child, ), @@ -103,17 +96,9 @@ class OS26Surface extends StatelessWidget { @override Widget build(BuildContext context) { - final isDark = ShadTheme.of(context).brightness == Brightness.dark; + final cs = ShadTheme.of(context).colorScheme; return DecoratedBox( - decoration: BoxDecoration( - gradient: LinearGradient( - begin: Alignment.topLeft, - end: Alignment.bottomRight, - colors: isDark - ? const [Color(0xFF0B1220), Color(0xFF111827), Color(0xFF20151A)] - : const [Color(0xFFE9F6F5), Color(0xFFF6FAF6), Color(0xFFF9E6D4)], - ), - ), + decoration: BoxDecoration(color: cs.background), child: child, ); } @@ -138,7 +123,7 @@ class OS26Glass extends StatelessWidget { @override Widget build(BuildContext context) { final theme = ShadTheme.of(context); - final isDark = theme.brightness == Brightness.dark; + final cs = theme.colorScheme; return ClipRRect( borderRadius: BorderRadius.circular(radius), child: BackdropFilter( @@ -146,18 +131,9 @@ class OS26Glass extends StatelessWidget { child: Container( padding: padding, decoration: BoxDecoration( - color: isDark - ? theme.colorScheme.card.withValues(alpha: opacity + 0.18) - : Colors.white.withValues(alpha: opacity), + color: cs.card.withValues(alpha: opacity.clamp(0.0, 1.0)), borderRadius: BorderRadius.circular(radius), - border: - border ?? - Border.all( - color: isDark - ? theme.colorScheme.border.withValues(alpha: 0.9) - : Colors.white.withValues(alpha: 0.58), - width: 1, - ), + border: border ?? Border.all(color: cs.border, width: 1), ), child: child, ), diff --git a/lib/pages/workspace_page.dart b/lib/pages/workspace_page.dart index 2a8b5df..0d13d46 100644 --- a/lib/pages/workspace_page.dart +++ b/lib/pages/workspace_page.dart @@ -523,9 +523,7 @@ class _SegmentButton extends StatelessWidget { @override Widget build(BuildContext context) { - final theme = ShadTheme.of(context); - final cs = theme.colorScheme; - final isDark = theme.brightness == Brightness.dark; + final cs = ShadTheme.of(context).colorScheme; return InkWell( borderRadius: BorderRadius.circular(10), onTap: onTap, @@ -534,16 +532,12 @@ class _SegmentButton extends StatelessWidget { width: 126, height: 32, decoration: BoxDecoration( - color: selected - ? (isDark ? cs.secondary : Colors.white.withValues(alpha: 0.74)) - : Colors.transparent, + color: selected ? cs.secondary : Colors.transparent, borderRadius: BorderRadius.circular(10), boxShadow: selected ? [ BoxShadow( - color: (isDark ? Colors.black : Colors.black).withValues( - alpha: isDark ? 0.28 : 0.08, - ), + color: cs.border.withValues(alpha: 0.7), blurRadius: 10, offset: const Offset(0, 3), ), @@ -1229,9 +1223,7 @@ class _ToolbarButton extends StatelessWidget { @override Widget build(BuildContext context) { - final theme = ShadTheme.of(context); - final cs = theme.colorScheme; - final isDark = theme.brightness == Brightness.dark; + final cs = ShadTheme.of(context).colorScheme; return ShadTooltip( builder: (_) => Text(label), child: Padding( @@ -1250,9 +1242,7 @@ class _ToolbarButton extends StatelessWidget { ? cs.primary.withValues(alpha: 0.14) : grouped ? Colors.transparent - : (isDark - ? cs.secondary.withValues(alpha: 0.88) - : Colors.white.withValues(alpha: 0.46)), + : cs.secondary, borderRadius: BorderRadius.circular(10), border: Border.all( color: primary @@ -1261,9 +1251,7 @@ class _ToolbarButton extends StatelessWidget { ? cs.primary.withValues(alpha: 0.45) : grouped ? Colors.transparent - : (isDark - ? cs.border.withValues(alpha: 0.9) - : Colors.white.withValues(alpha: 0.54)), + : cs.border, ), ), child: Row( @@ -1305,22 +1293,14 @@ class _ToolbarControlGroup extends StatelessWidget { @override Widget build(BuildContext context) { - final theme = ShadTheme.of(context); - final cs = theme.colorScheme; - final isDark = theme.brightness == Brightness.dark; + final cs = ShadTheme.of(context).colorScheme; return Container( height: 36, padding: const EdgeInsets.symmetric(horizontal: 2), decoration: BoxDecoration( - color: isDark - ? cs.secondary.withValues(alpha: 0.88) - : Colors.white.withValues(alpha: 0.46), + color: cs.secondary, borderRadius: BorderRadius.circular(10), - border: Border.all( - color: isDark - ? cs.border.withValues(alpha: 0.9) - : Colors.white.withValues(alpha: 0.54), - ), + border: Border.all(color: cs.border), ), child: Row(mainAxisSize: MainAxisSize.min, children: children), ); @@ -2220,9 +2200,7 @@ class _FinderColumnState extends State<_FinderColumn> { @override Widget build(BuildContext context) { - final theme = ShadTheme.of(context); - final cs = theme.colorScheme; - final isDark = theme.brightness == Brightness.dark; + final cs = ShadTheme.of(context).colorScheme; final column = widget.column; return FocusableActionDetector( focusNode: _focusNode, @@ -2278,9 +2256,7 @@ class _FinderColumnState extends State<_FinderColumn> { decoration: BoxDecoration( color: _dragActive || candidates.isNotEmpty ? cs.primary.withValues(alpha: 0.10) - : (isDark - ? cs.secondary.withValues(alpha: 0.62) - : Colors.white.withValues(alpha: 0.22)), + : cs.secondary, border: Border( right: BorderSide(color: cs.border.withValues(alpha: 0.70)), left: BorderSide( @@ -2483,9 +2459,7 @@ class _FileGridCard extends StatelessWidget { @override Widget build(BuildContext context) { - final theme = ShadTheme.of(context); - final cs = theme.colorScheme; - final isDark = theme.brightness == Brightness.dark; + final cs = ShadTheme.of(context).colorScheme; return Semantics( button: true, label: @@ -2496,11 +2470,7 @@ class _FileGridCard extends StatelessWidget { child: Container( padding: const EdgeInsets.all(10), decoration: BoxDecoration( - color: isSelected - ? cs.primary.withValues(alpha: 0.12) - : (isDark - ? cs.secondary.withValues(alpha: 0.78) - : Colors.white.withValues(alpha: 0.34)), + color: isSelected ? cs.primary.withValues(alpha: 0.12) : cs.card, borderRadius: BorderRadius.circular(8), border: Border.all( color: isSelected @@ -3291,24 +3261,16 @@ class _FilePaneFrame extends StatelessWidget { @override Widget build(BuildContext context) { - final theme = ShadTheme.of(context); - final cs = theme.colorScheme; - final isDark = theme.brightness == Brightness.dark; + final cs = ShadTheme.of(context).colorScheme; return _PaneDropSurface( parentID: dropParentID, onMoveCloudFiles: onMoveCloudFiles, onUploadLocalFiles: onUploadLocalFiles, child: Container( decoration: BoxDecoration( - color: isDark - ? cs.card.withValues(alpha: 0.92) - : Colors.white.withValues(alpha: 0.42), + color: cs.card, borderRadius: BorderRadius.circular(14), - border: Border.all( - color: isDark - ? cs.border.withValues(alpha: 0.92) - : Colors.white.withValues(alpha: 0.62), - ), + border: Border.all(color: cs.border), ), child: Column( children: [ diff --git a/lib/widgets/file_list_tile.dart b/lib/widgets/file_list_tile.dart index bd8f995..2d5aa8d 100644 --- a/lib/widgets/file_list_tile.dart +++ b/lib/widgets/file_list_tile.dart @@ -132,7 +132,7 @@ class _FileListTileState extends State { @override Widget build(BuildContext context) { final theme = ShadTheme.of(context); - final isDark = theme.brightness == Brightness.dark; + final cs = theme.colorScheme; return ShadContextMenuRegion( items: [ ShadContextMenuItem.inset( @@ -210,20 +210,9 @@ class _FileListTileState extends State { padding: const EdgeInsets.symmetric(horizontal: 12), decoration: BoxDecoration( color: widget.isSelected - ? (isDark - ? theme.colorScheme.primary.withAlpha(30) - : theme.colorScheme.primary.withAlpha(15)) - : (isDark - ? Colors.white.withAlpha(3) - : Colors.black.withAlpha(2)), - border: Border( - bottom: BorderSide( - color: isDark - ? Colors.white.withAlpha(10) - : Colors.black.withAlpha(8), - width: 0.5, - ), - ), + ? cs.primary.withValues(alpha: 0.14) + : cs.card, + border: Border(bottom: BorderSide(color: cs.border, width: 0.5)), ), child: Row( children: [ diff --git a/lib/widgets/sort_menu.dart b/lib/widgets/sort_menu.dart index a0de5aa..f8f586b 100644 --- a/lib/widgets/sort_menu.dart +++ b/lib/widgets/sort_menu.dart @@ -18,21 +18,13 @@ class SortMenu extends StatelessWidget { @override Widget build(BuildContext context) { - final theme = ShadTheme.of(context); - final cs = theme.colorScheme; - final isDark = theme.brightness == Brightness.dark; + final cs = ShadTheme.of(context).colorScheme; return Container( height: 36, decoration: BoxDecoration( - color: isDark - ? cs.secondary.withValues(alpha: 0.88) - : Colors.white.withValues(alpha: 0.46), + color: cs.secondary, borderRadius: BorderRadius.circular(10), - border: Border.all( - color: isDark - ? cs.border.withValues(alpha: 0.9) - : Colors.white.withValues(alpha: 0.54), - ), + border: Border.all(color: cs.border), ), child: Row( mainAxisSize: MainAxisSize.min,