Skip to content

Commit de258c3

Browse files
committed
fix: improve light mode visibility and OCD tracker UI
- Use deeper gold (#B8960F) for light mode primary color to improve contrast on white backgrounds while keeping bright yellow for dark mode - Fix obsession/compulsion toggle text clipping by removing fixed width and simplifying layout to size naturally - Replace red warning triangle on high distress filter with a subtler filter icon using the theme's primary color
1 parent c5780b7 commit de258c3

2 files changed

Lines changed: 42 additions & 49 deletions

File tree

lib/screens/ocd_tracker_screen.dart

Lines changed: 34 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ class _OcdTrackerScreenState extends ConsumerState<OcdTrackerScreen> {
4949
Padding(
5050
padding: const EdgeInsets.only(right: 12.0),
5151
child: Container(
52-
width: 260,
53-
margin: const EdgeInsets.symmetric(vertical: 6),
5452
decoration: BoxDecoration(
5553
color: theme.colorScheme.onSurface.withOpacity(0.05),
56-
borderRadius: BorderRadius.circular(10),
54+
borderRadius: BorderRadius.circular(8),
55+
border: Border.all(color: theme.dividerColor),
5756
),
5857
padding: const EdgeInsets.all(3),
5958
child: Row(
59+
mainAxisSize: MainAxisSize.min,
6060
children: [
6161
_TypeOption(
6262
label: 'Obsessions',
@@ -115,28 +115,28 @@ class _HighDistressToggle extends StatelessWidget {
115115
child: Container(
116116
decoration: BoxDecoration(
117117
borderRadius: BorderRadius.circular(8),
118-
border: Border.all(color: isSelected ? Colors.redAccent.withOpacity(0.5) : theme.dividerColor),
118+
border: Border.all(color: isSelected ? theme.colorScheme.primary.withOpacity(0.5) : theme.dividerColor),
119119
),
120120
child: AnimatedContainer(
121121
duration: const Duration(milliseconds: 200),
122122
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
123123
decoration: BoxDecoration(
124-
color: isSelected ? Colors.redAccent.withOpacity(0.1) : Colors.transparent,
124+
color: isSelected ? theme.colorScheme.primary.withOpacity(0.1) : Colors.transparent,
125125
borderRadius: BorderRadius.circular(8),
126126
),
127127
child: Row(
128128
mainAxisSize: MainAxisSize.min,
129129
children: [
130130
Icon(
131-
LineIcons.exclamationTriangle,
132-
size: 18,
133-
color: isSelected ? Colors.redAccent : theme.colorScheme.onSurface.withOpacity(0.4)
131+
isSelected ? LineIcons.filter : LineIcons.filter,
132+
size: 16,
133+
color: isSelected ? theme.colorScheme.primary : theme.colorScheme.onSurface.withOpacity(0.4)
134134
),
135135
if (isSelected) ...[
136-
const SizedBox(width: 8),
137-
const Text(
138-
'HIGH DISTRESS',
139-
style: TextStyle(color: Colors.redAccent, fontSize: 10, fontWeight: FontWeight.w800, letterSpacing: 0.5)
136+
const SizedBox(width: 6),
137+
Text(
138+
'7+',
139+
style: TextStyle(color: theme.colorScheme.primary, fontSize: 11, fontWeight: FontWeight.w800)
140140
),
141141
]
142142
],
@@ -170,37 +170,29 @@ class _TypeOptionState extends State<_TypeOption> {
170170

171171
@override
172172
Widget build(BuildContext context) {
173-
return Expanded(
174-
child: MouseRegion(
175-
cursor: SystemMouseCursors.click,
176-
onEnter: (_) => setState(() => _isHovered = true),
177-
onExit: (_) => setState(() => _isHovered = false),
178-
child: GestureDetector(
179-
onTap: widget.onTap,
180-
child: Container(
181-
decoration: BoxDecoration(
182-
color: widget.isSelected ? widget.theme.colorScheme.primary : Colors.transparent,
183-
borderRadius: BorderRadius.circular(8),
184-
),
185-
child: AnimatedContainer(
186-
duration: const Duration(milliseconds: 200),
187-
padding: const EdgeInsets.symmetric(vertical: 8),
188-
decoration: BoxDecoration(
189-
color: !widget.isSelected && _isHovered
190-
? widget.theme.colorScheme.onSurface.withOpacity(0.05)
173+
return MouseRegion(
174+
cursor: SystemMouseCursors.click,
175+
onEnter: (_) => setState(() => _isHovered = true),
176+
onExit: (_) => setState(() => _isHovered = false),
177+
child: GestureDetector(
178+
onTap: widget.onTap,
179+
child: AnimatedContainer(
180+
duration: const Duration(milliseconds: 200),
181+
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 6),
182+
decoration: BoxDecoration(
183+
color: widget.isSelected
184+
? widget.theme.colorScheme.primary
185+
: _isHovered
186+
? widget.theme.colorScheme.onSurface.withOpacity(0.05)
191187
: Colors.transparent,
192-
borderRadius: BorderRadius.circular(8),
193-
),
194-
child: Center(
195-
child: Text(
196-
widget.label,
197-
style: TextStyle(
198-
fontSize: 13,
199-
fontWeight: FontWeight.w700,
200-
color: widget.isSelected ? widget.theme.colorScheme.onPrimary : widget.theme.colorScheme.onSurface.withOpacity(_isHovered ? 0.7 : 0.4),
201-
),
202-
),
203-
),
188+
borderRadius: BorderRadius.circular(6),
189+
),
190+
child: Text(
191+
widget.label,
192+
style: TextStyle(
193+
fontSize: 12,
194+
fontWeight: FontWeight.w600,
195+
color: widget.isSelected ? widget.theme.colorScheme.onPrimary : widget.theme.colorScheme.onSurface.withOpacity(_isHovered ? 0.7 : 0.4),
204196
),
205197
),
206198
),

lib/theme/app_theme.dart

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import 'package:google_fonts/google_fonts.dart';
33

44
class AppTheme {
55
static const Color primaryYellow = Color(0xFFFFD700); // Bright Yellow for Dark
6-
static const Color primaryAmber = Color(0xFFB45309); // Darker Amber for Light (Accessibility)
6+
static const Color primaryGold = Color(0xFFB8960F); // Deep Gold for Light (readable on white)
7+
static const Color primaryAmber = Color(0xFFB45309); // Darker Amber (unused, kept for reference)
78

89
// Refined Dark Palette
910
static const Color darkBg = Color(0xFF000000);
@@ -98,9 +99,9 @@ class AppTheme {
9899
useMaterial3: true,
99100
brightness: Brightness.light,
100101
colorScheme: ColorScheme.light(
101-
primary: primaryYellow,
102+
primary: primaryGold,
102103
onPrimary: Colors.black,
103-
secondary: primaryYellow,
104+
secondary: primaryGold,
104105
surface: lightSurface,
105106
background: lightBg,
106107
onSurface: lightTextPrimary,
@@ -134,7 +135,7 @@ class AppTheme {
134135
),
135136
elevatedButtonTheme: ElevatedButtonThemeData(
136137
style: ElevatedButton.styleFrom(
137-
backgroundColor: primaryYellow,
138+
backgroundColor: primaryGold,
138139
foregroundColor: Colors.black,
139140
elevation: 0,
140141
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 12),
@@ -144,8 +145,8 @@ class AppTheme {
144145
),
145146
outlinedButtonTheme: OutlinedButtonThemeData(
146147
style: OutlinedButton.styleFrom(
147-
foregroundColor: Colors.black, // Darker text for visibility on light bg
148-
side: const BorderSide(color: primaryYellow, width: 2.0),
148+
foregroundColor: Colors.black,
149+
side: const BorderSide(color: primaryGold, width: 2.0),
149150
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
150151
textStyle: GoogleFonts.inter(fontWeight: FontWeight.w700, letterSpacing: -0.2),
151152
),
@@ -163,7 +164,7 @@ class AppTheme {
163164
),
164165
focusedBorder: OutlineInputBorder(
165166
borderRadius: BorderRadius.circular(8),
166-
borderSide: const BorderSide(color: primaryYellow, width: 2.0),
167+
borderSide: const BorderSide(color: primaryGold, width: 2.0),
167168
),
168169
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 16),
169170
),

0 commit comments

Comments
 (0)