Skip to content

Commit 28513f5

Browse files
Merge branch 'main' into dev
2 parents 6ea2bb6 + d380522 commit 28513f5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2253
-1054
lines changed

lib/config/taskwarriorcolors.dart

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,37 @@
11
// ignore_for_file: file_names
22

33
import 'package:flutter/material.dart';
4+
import 'package:taskwarrior/widgets/pallete.dart';
45

5-
class Appcolors {
6+
class TaskWarriorColors {
7+
// Normal Colors
68
static Color red = Colors.red;
79
static Color green = Colors.green;
810
static Color yellow = Colors.yellow;
911
static Color white = Colors.white;
12+
static Color black = Colors.black;
13+
static Color grey = Colors.grey;
14+
static Color? lightGrey = Colors.grey[600];
15+
static Color purple = Colors.purple;
16+
static Color borderColor = Colors.grey.shade300;
17+
static Color deepPurpleAccent = Colors.deepPurpleAccent;
18+
static Color deepPurple = Colors.deepPurple;
19+
20+
// Dark Theme Color Palette
21+
static Color kprimaryBackgroundColor = Palette.kToDark.shade200;
22+
static Color ksecondaryBackgroundColor =
23+
const Color.fromARGB(255, 48, 46, 46);
24+
static Color kprimaryTextColor = Colors.white;
25+
static Color ksecondaryTextColor = Colors.white;
26+
static Color kprimaryDisabledTextColor = const Color(0xff595f6b);
27+
static Color kdialogBackGroundColor = const Color.fromARGB(255, 25, 25, 25);
28+
29+
// Light Theme Color Palette
30+
static Color kLightPrimaryBackgroundColor = Colors.white;
31+
static Color kLightSecondaryBackgroundColor =
32+
const Color.fromARGB(255, 220, 216, 216);
33+
static Color kLightPrimaryTextColor = Colors.black;
34+
static Color kLightSecondaryTextColor = const Color.fromARGB(255, 48, 46, 46);
35+
static Color kLightPrimaryDisabledTextColor = const Color(0xffACACAB);
36+
static Color kLightDialogBackGroundColor = Colors.white;
1037
}

lib/config/taskwarriorfonts.dart

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import 'package:flutter/material.dart';
2+
3+
class TaskWarriorFonts {
4+
// Font weights
5+
static const FontWeight thin = FontWeight.w100;
6+
static const FontWeight extraLight = FontWeight.w200;
7+
static const FontWeight light = FontWeight.w300;
8+
static const FontWeight regular = FontWeight.w400;
9+
static const FontWeight medium = FontWeight.w500;
10+
static const FontWeight semiBold = FontWeight.w600;
11+
static const FontWeight bold = FontWeight.w700;
12+
static const FontWeight extraBold = FontWeight.w800;
13+
static const FontWeight black = FontWeight.w900;
14+
15+
// Font sizes
16+
static const double fontSizeSmall = 12.0;
17+
static const double fontSizeMedium = 16.0;
18+
static const double fontSizeLarge = 20.0;
19+
static const double fontSizeExtraLarge = 24.0;
20+
}

lib/config/theme_switcher_clipper.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// ignore_for_file: library_private_types_in_public_api
22

33
import 'package:flutter/material.dart';
4+
import 'package:taskwarrior/config/taskwarriorcolors.dart';
45

56
class ThemeSwitcherClipper extends StatefulWidget {
67
final bool isDarkMode;
@@ -36,7 +37,9 @@ class _ThemeSwitcherClipperState extends State<ThemeSwitcherClipper> {
3637
child: Icon(
3738
widget.isDarkMode ? Icons.dark_mode : Icons.light_mode,
3839
key: UniqueKey(),
39-
color: widget.isDarkMode ? Colors.white : Colors.black,
40+
color: widget.isDarkMode
41+
? TaskWarriorColors.white
42+
: TaskWarriorColors.black,
4043
size: 40,
4144
),
4245
)),

lib/controller/WidgetController.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import 'package:flutter/material.dart';
77
import 'package:flutter/services.dart';
88
import 'package:get/get.dart'; // Import the GetX package
99
import 'package:home_widget/home_widget.dart';
10-
// ignore: depend_on_referenced_packages
11-
import 'package:path_provider/path_provider.dart';
1210
import 'package:syncfusion_flutter_charts/charts.dart';
1311
import 'package:taskwarrior/views/home/home.dart';
1412
import 'package:taskwarrior/widgets/taskdetails/profiles_widget.dart';
@@ -36,7 +34,7 @@ class WidgetController extends GetxController {
3634
storageWidget = StorageWidget.of(context!); // Use Get.context from GetX
3735
var currentProfile = ProfilesWidget.of(context!).currentProfile;
3836

39-
baseDirectory = await getApplicationDocumentsDirectory();
37+
baseDirectory = ProfilesWidget.of(context!).getBaseDirectory();
4038
storage =
4139
Storage(Directory('${baseDirectory!.path}/profiles/$currentProfile'));
4240

lib/drawer/filter_drawer.dart

Lines changed: 45 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import 'package:flutter/material.dart';
44
import 'package:google_fonts/google_fonts.dart';
55

66
import 'package:taskwarrior/config/app_settings.dart';
7+
import 'package:taskwarrior/config/taskwarriorcolors.dart';
8+
import 'package:taskwarrior/config/taskwarriorfonts.dart';
79
import 'package:taskwarrior/controller/filter_drawer_tour_controller.dart';
810
import 'package:taskwarrior/drawer/filter_drawer_tour.dart';
911
import 'package:taskwarrior/model/storage/storage_widget.dart';
@@ -30,8 +32,8 @@ class _FilterDrawerState extends State<FilterDrawer> {
3032

3133
bool isSaved = false;
3234
var tileColor = AppSettings.isDarkMode
33-
? const Color.fromARGB(255, 48, 46, 46)
34-
: const Color.fromARGB(255, 220, 216, 216);
35+
? TaskWarriorColors.ksecondaryBackgroundColor
36+
: TaskWarriorColors.kLightPrimaryBackgroundColor;
3537
late TutorialCoachMark tutorialCoachMark;
3638

3739
void _initFilterDrawerTour() {
@@ -42,7 +44,7 @@ class _FilterDrawerState extends State<FilterDrawer> {
4244
filterTagKey: filterTagKey,
4345
sortByKey: sortByKey,
4446
),
45-
colorShadow: Colors.black,
47+
colorShadow: TaskWarriorColors.black,
4648
paddingFocus: 10,
4749
opacityShadow: 1.00,
4850
hideSkip: true,
@@ -83,8 +85,11 @@ class _FilterDrawerState extends State<FilterDrawer> {
8385
var storageWidget = StorageWidget.of(context);
8486
return Drawer(
8587
backgroundColor: AppSettings.isDarkMode
86-
? Color.fromARGB(255, 29, 29, 29)
87-
: Colors.white,
88+
? TaskWarriorColors.kprimaryBackgroundColor
89+
: TaskWarriorColors.kLightPrimaryBackgroundColor,
90+
surfaceTintColor: AppSettings.isDarkMode
91+
? TaskWarriorColors.kprimaryBackgroundColor
92+
: TaskWarriorColors.kLightPrimaryBackgroundColor,
8893
child: SafeArea(
8994
child: Padding(
9095
padding: const EdgeInsets.all(8),
@@ -103,11 +108,11 @@ class _FilterDrawerState extends State<FilterDrawer> {
103108
child: Text(
104109
'Apply Filters',
105110
style: GoogleFonts.poppins(
106-
fontWeight: FontWeight.bold,
111+
fontWeight: TaskWarriorFonts.bold,
107112
color: (AppSettings.isDarkMode
108-
? Colors.white
109-
: Color.fromARGB(255, 48, 46, 46)),
110-
fontSize: 25),
113+
? TaskWarriorColors.kprimaryTextColor
114+
: TaskWarriorColors.kLightPrimaryTextColor),
115+
fontSize: TaskWarriorFonts.fontSizeExtraLarge),
111116
),
112117
),
113118
),
@@ -120,7 +125,7 @@ class _FilterDrawerState extends State<FilterDrawer> {
120125
decoration: BoxDecoration(
121126
color: tileColor,
122127
borderRadius: BorderRadius.circular(8),
123-
border: Border.all(color: Colors.grey.shade300),
128+
border: Border.all(color: TaskWarriorColors.borderColor),
124129
),
125130
child: ListTile(
126131
contentPadding: EdgeInsets.only(
@@ -134,31 +139,31 @@ class _FilterDrawerState extends State<FilterDrawer> {
134139
TextSpan(
135140
text: 'Status : ',
136141
style: GoogleFonts.poppins(
137-
fontWeight: FontWeight.bold,
138-
fontSize: 15,
142+
fontWeight: TaskWarriorFonts.bold,
143+
fontSize: TaskWarriorFonts.fontSizeMedium,
139144
color: AppSettings.isDarkMode
140-
? Colors.white
141-
: Colors.black,
145+
? TaskWarriorColors.white
146+
: TaskWarriorColors.black,
142147
),
143148
),
144149
TextSpan(
145150
text: widget.filters.pendingFilter
146151
? 'pending'
147152
: 'completed',
148153
style: GoogleFonts.poppins(
149-
fontSize: 15,
154+
fontSize: TaskWarriorFonts.fontSizeMedium,
150155
color: AppSettings.isDarkMode
151-
? Colors.white
152-
: Colors.black,
156+
? TaskWarriorColors.white
157+
: TaskWarriorColors.black,
153158
),
154159
),
155160
],
156161
),
157162
),
158163
onTap: widget.filters.togglePendingFilter,
159164
textColor: AppSettings.isDarkMode
160-
? Colors.white
161-
: Color.fromARGB(255, 48, 46, 46),
165+
? TaskWarriorColors.kprimaryTextColor
166+
: TaskWarriorColors.kLightSecondaryTextColor,
162167
),
163168
),
164169
const Divider(
@@ -171,7 +176,7 @@ class _FilterDrawerState extends State<FilterDrawer> {
171176
decoration: BoxDecoration(
172177
color: tileColor,
173178
borderRadius: BorderRadius.circular(8),
174-
border: Border.all(color: Colors.grey.shade300),
179+
border: Border.all(color: TaskWarriorColors.borderColor),
175180
),
176181
child: ProjectsColumn(
177182
widget.filters.projects,
@@ -189,7 +194,7 @@ class _FilterDrawerState extends State<FilterDrawer> {
189194
decoration: BoxDecoration(
190195
color: tileColor,
191196
borderRadius: BorderRadius.circular(8),
192-
border: Border.all(color: Colors.grey.shade300),
197+
border: Border.all(color: TaskWarriorColors.borderColor),
193198
),
194199
child: Column(
195200
mainAxisAlignment: MainAxisAlignment.center,
@@ -203,10 +208,10 @@ class _FilterDrawerState extends State<FilterDrawer> {
203208
'Filter Tag By:',
204209
style: GoogleFonts.poppins(
205210
color: (AppSettings.isDarkMode
206-
? Colors.white
207-
: Color.fromARGB(255, 48, 46, 46)),
211+
? TaskWarriorColors.kprimaryTextColor
212+
: TaskWarriorColors.kLightSecondaryTextColor),
208213
//
209-
fontSize: 18),
214+
fontSize: TaskWarriorFonts.fontSizeLarge),
210215
//textAlign: TextAlign.right,
211216
),
212217
),
@@ -233,7 +238,7 @@ class _FilterDrawerState extends State<FilterDrawer> {
233238
decoration: BoxDecoration(
234239
color: tileColor,
235240
borderRadius: BorderRadius.circular(8),
236-
border: Border.all(color: Colors.grey.shade300),
241+
border: Border.all(color: TaskWarriorColors.borderColor),
237242
),
238243
//height: 30,
239244
child: Column(
@@ -247,9 +252,9 @@ class _FilterDrawerState extends State<FilterDrawer> {
247252
'Sort By',
248253
style: GoogleFonts.poppins(
249254
color: (AppSettings.isDarkMode
250-
? Colors.white
251-
: Color.fromARGB(255, 48, 46, 46)),
252-
fontSize: 18),
255+
? TaskWarriorColors.kprimaryTextColor
256+
: TaskWarriorColors.kLightPrimaryTextColor),
257+
fontSize: TaskWarriorFonts.fontSizeLarge),
253258
// textAlign: TextAlign.right,
254259
),
255260
),
@@ -292,11 +297,12 @@ class _FilterDrawerState extends State<FilterDrawer> {
292297
},
293298
labelStyle: GoogleFonts.poppins(
294299
color: AppSettings.isDarkMode
295-
? Colors.black
296-
: Colors.white),
300+
? TaskWarriorColors.black
301+
: TaskWarriorColors.white),
297302
backgroundColor: AppSettings.isDarkMode
298-
? Color.fromARGB(255, 220, 216, 216)
299-
: Color.fromARGB(255, 48, 46, 46),
303+
? TaskWarriorColors
304+
.kLightSecondaryBackgroundColor
305+
: TaskWarriorColors.ksecondaryBackgroundColor,
300306
),
301307
],
302308
),
@@ -307,11 +313,10 @@ class _FilterDrawerState extends State<FilterDrawer> {
307313
Container(
308314
width: 200,
309315
decoration: BoxDecoration(
310-
borderRadius: BorderRadius.circular(10),
311-
color: AppSettings.isDarkMode
312-
? Color.fromARGB(255, 220, 216, 216)
313-
: Color.fromARGB(255, 48, 46, 46),
314-
),
316+
borderRadius: BorderRadius.circular(10),
317+
color: AppSettings.isDarkMode
318+
? TaskWarriorColors.kLightSecondaryBackgroundColor
319+
: TaskWarriorColors.ksecondaryBackgroundColor),
315320
child: TextButton(
316321
onPressed: () {
317322
if (storageWidget.selectedSort.endsWith('+') ||
@@ -324,10 +329,10 @@ class _FilterDrawerState extends State<FilterDrawer> {
324329
child: Text(
325330
'Reset Sort',
326331
style: GoogleFonts.poppins(
327-
fontSize: 15,
332+
fontSize: TaskWarriorFonts.fontSizeMedium,
328333
color: AppSettings.isDarkMode
329-
? Color.fromARGB(255, 48, 46, 46)
330-
: Colors.white),
334+
? TaskWarriorColors.kLightSecondaryTextColor
335+
: TaskWarriorColors.ksecondaryTextColor),
331336
)),
332337
),
333338
const Divider(

lib/drawer/filter_drawer_tour.dart

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'package:flutter/material.dart';
22
import 'package:google_fonts/google_fonts.dart';
3+
import 'package:taskwarrior/config/taskwarriorcolors.dart';
34
import 'package:tutorial_coach_mark/tutorial_coach_mark.dart';
45

56
List<TargetFocus> filterDrawer({
@@ -31,7 +32,7 @@ List<TargetFocus> filterDrawer({
3132
"Filter tasks based on their completion status",
3233
textAlign: TextAlign.center,
3334
style: GoogleFonts.poppins(
34-
color: Colors.white,
35+
color: TaskWarriorColors.white,
3536
),
3637
),
3738
],
@@ -64,7 +65,7 @@ List<TargetFocus> filterDrawer({
6465
"Filter tasks based on the projects",
6566
textAlign: TextAlign.center,
6667
style: GoogleFonts.poppins(
67-
color: Colors.white,
68+
color: TaskWarriorColors.white,
6869
),
6970
),
7071
],
@@ -97,7 +98,7 @@ List<TargetFocus> filterDrawer({
9798
"Toggle between AND and OR tag union types",
9899
textAlign: TextAlign.center,
99100
style: GoogleFonts.poppins(
100-
color: Colors.white,
101+
color: TaskWarriorColors.white,
101102
),
102103
),
103104
],
@@ -130,7 +131,7 @@ List<TargetFocus> filterDrawer({
130131
"Sort tasks based on time of creation, urgency, due date, start date, etc.",
131132
textAlign: TextAlign.center,
132133
style: GoogleFonts.poppins(
133-
color: Colors.white,
134+
color: TaskWarriorColors.white,
134135
),
135136
),
136137
],

0 commit comments

Comments
 (0)