Skip to content

Commit 4b0e584

Browse files
committed
fix: black color theme
1 parent bacf05a commit 4b0e584

5 files changed

Lines changed: 258 additions & 61 deletions

File tree

src/lib/features/main/view/screens/main_screen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class _MainScreenState extends State<MainScreen> {
3333
child: const StatisticsScreen(),
3434
),
3535
ChangeNotifierProvider(
36-
create: (_) => UserProfileViewModel()..loadProfile(),
36+
create: (_) => UserProfileViewModel(useMockData: true)..loadProfile(),
3737
child: const UserProfileView(),
3838
),
3939
const SettingsScreen(),

src/lib/features/note/view/focus_screen.dart

Lines changed: 108 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ class FocusScreen extends StatelessWidget {
99
// Shows the configuration dialog for timer and notification settings
1010
void _showSettingsDialog(BuildContext context) {
1111
final vm = context.read<FocusViewModel>();
12+
final isDark = Theme.of(context).brightness == Brightness.dark;
1213

1314
double currentPomodoro = (vm.pomodoroTime / 60).toDouble();
1415
double currentBreak = (vm.shortBreakTime / 60).toDouble();
@@ -21,9 +22,16 @@ class FocusScreen extends StatelessWidget {
2122
return StatefulBuilder(
2223
builder: (context, setStateDialog) {
2324
return AlertDialog(
24-
backgroundColor: Colors.white,
25+
backgroundColor:
26+
isDark ? const Color(0xFF1A2945) : Theme.of(context).colorScheme.surface,
2527
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)),
26-
title: const Text('Cài đặt', style: TextStyle(fontWeight: FontWeight.bold, color: Color(0xFF2C3E50))),
28+
title: Text(
29+
'Cài đặt',
30+
style: TextStyle(
31+
fontWeight: FontWeight.bold,
32+
color: Theme.of(context).colorScheme.onSurface,
33+
),
34+
),
2735
content: SingleChildScrollView(
2836
child: Column(
2937
mainAxisSize: MainAxisSize.min,
@@ -33,7 +41,14 @@ class FocusScreen extends StatelessWidget {
3341
Row(
3442
mainAxisAlignment: MainAxisAlignment.spaceBetween,
3543
children: [
36-
const Text('Pomodoro', style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14)),
44+
Text(
45+
'Pomodoro',
46+
style: TextStyle(
47+
fontWeight: FontWeight.bold,
48+
fontSize: 14,
49+
color: Theme.of(context).colorScheme.onSurface,
50+
),
51+
),
3752
Text(
3853
'${currentPomodoro.toInt()} phút',
3954
style: TextStyle(
@@ -55,29 +70,69 @@ class FocusScreen extends StatelessWidget {
5570
Row(
5671
mainAxisAlignment: MainAxisAlignment.spaceBetween,
5772
children: [
58-
const Text('Nghỉ ngắn', style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14)),
73+
Text(
74+
'Nghỉ ngắn',
75+
style: TextStyle(
76+
fontWeight: FontWeight.bold,
77+
fontSize: 14,
78+
color: Theme.of(context).colorScheme.onSurface,
79+
),
80+
),
5981
Text('${currentBreak.toInt()} phút', style: const TextStyle(color: Colors.orange, fontWeight: FontWeight.bold)),
6082
],
6183
),
62-
Slider(value: currentBreak, min: 1, max: 30, divisions: 29, activeColor: Colors.orange, onChanged: (val) => setStateDialog(() => currentBreak = val)),
63-
const Divider(height: 30),
84+
Slider(
85+
value: currentBreak,
86+
min: 1,
87+
max: 30,
88+
divisions: 29,
89+
activeColor: Colors.orange,
90+
onChanged: (val) => setStateDialog(() => currentBreak = val),
91+
),
92+
Divider(
93+
height: 30,
94+
color: Theme.of(context).colorScheme.outline,
95+
),
6496

6597
// --- Hardware Settings ---
6698
SwitchListTile(
67-
title: const Text('Rung', style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14)),
99+
title: Text(
100+
'Rung',
101+
style: TextStyle(
102+
fontWeight: FontWeight.bold,
103+
fontSize: 14,
104+
color: Theme.of(context).colorScheme.onSurface,
105+
),
106+
),
68107
value: currentVibrate,
69-
activeColor: Theme.of(context).colorScheme.primary,
108+
activeThumbColor: Theme.of(context).colorScheme.primary,
70109
contentPadding: EdgeInsets.zero,
71110
onChanged: (val) => setStateDialog(() => currentVibrate = val),
72111
),
73112
const SizedBox(height: 10),
74-
const Text('Âm thanh', style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14)),
113+
Text(
114+
'Âm thanh',
115+
style: TextStyle(
116+
fontWeight: FontWeight.bold,
117+
fontSize: 14,
118+
color: Theme.of(context).colorScheme.onSurface,
119+
),
120+
),
75121
const SizedBox(height: 10),
76122
Container(
77123
padding: const EdgeInsets.symmetric(horizontal: 15),
78-
decoration: BoxDecoration(color: const Color(0xFFF4F6F9), borderRadius: BorderRadius.circular(15)),
124+
decoration: BoxDecoration(
125+
color: isDark
126+
? const Color(0xFF12223D)
127+
: Theme.of(context).colorScheme.surfaceContainerHighest,
128+
borderRadius: BorderRadius.circular(15),
129+
),
79130
child: DropdownButtonHideUnderline(
80131
child: DropdownButton<int>(
132+
dropdownColor: isDark
133+
? const Color(0xFF1A2945)
134+
: Theme.of(context).colorScheme.surface,
135+
style: TextStyle(color: Theme.of(context).colorScheme.onSurface),
81136
isExpanded: true,
82137
value: currentRingtone,
83138
items: const [
@@ -95,7 +150,14 @@ class FocusScreen extends StatelessWidget {
95150
),
96151
),
97152
actions: [
98-
TextButton(onPressed: () => Navigator.pop(context), child: const Text('Hủy', style: TextStyle(color: Colors.grey))),
153+
TextButton(
154+
onPressed: () => Navigator.pop(context),
155+
child: Text(
156+
'Hủy',
157+
style:
158+
TextStyle(color: Theme.of(context).colorScheme.onSurfaceVariant),
159+
),
160+
),
99161
ElevatedButton(
100162
onPressed: () {
101163
// Update settings in ViewModel
@@ -118,32 +180,57 @@ class FocusScreen extends StatelessWidget {
118180

119181
@override
120182
Widget build(BuildContext context) {
183+
final isDark = Theme.of(context).brightness == Brightness.dark;
184+
121185
return Scaffold(
122186
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
123-
body: SafeArea(
124-
child: SingleChildScrollView(
125-
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 20),
126-
child: Column(
187+
body: Container(
188+
decoration: BoxDecoration(
189+
gradient: isDark
190+
? const LinearGradient(
191+
begin: Alignment.topCenter,
192+
end: Alignment.bottomCenter,
193+
colors: [Color(0xFF08142D), Color(0xFF0B1A38), Color(0xFF0A1834)],
194+
)
195+
: null,
196+
),
197+
child: SafeArea(
198+
child: SingleChildScrollView(
199+
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 20),
200+
child: Column(
127201
crossAxisAlignment: CrossAxisAlignment.center,
128202
children: [
129203
// --- Header ---
130204
Row(
131205
mainAxisAlignment: MainAxisAlignment.spaceBetween,
132206
children: [
133-
const Row(
207+
Row(
134208
children: [
135-
CircleAvatar(radius: 22, backgroundImage: NetworkImage('https://i.pravatar.cc/150?u=a042581f4e29026704d')),
136-
SizedBox(width: 15),
137-
Text('Tập trung', style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold, color: Color(0xFF2C3E50))),
209+
const CircleAvatar(
210+
radius: 22,
211+
backgroundImage:
212+
NetworkImage('https://i.pravatar.cc/150?u=a042581f4e29026704d'),
213+
),
214+
const SizedBox(width: 15),
215+
Text(
216+
'Tập trung',
217+
style: TextStyle(
218+
fontSize: 24,
219+
fontWeight: FontWeight.bold,
220+
color: Theme.of(context).colorScheme.onSurface,
221+
),
222+
),
138223
],
139224
),
140225
// Settings Icon
141226
GestureDetector(
142227
onTap: () => _showSettingsDialog(context),
143228
child: Container(
144229
padding: const EdgeInsets.all(10),
145-
decoration: const BoxDecoration(
146-
color: Colors.white,
230+
decoration: BoxDecoration(
231+
color: isDark
232+
? const Color(0xFF172744)
233+
: Theme.of(context).colorScheme.surface,
147234
shape: BoxShape.circle,
148235
),
149236
child: Icon(

0 commit comments

Comments
 (0)