Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…utter into dev
  • Loading branch information
JangamRuthvik committed Mar 1, 2024
2 parents 1b02b67 + 49d4e92 commit 4061ee0
Show file tree
Hide file tree
Showing 41 changed files with 2,251 additions and 1,049 deletions.
29 changes: 28 additions & 1 deletion lib/config/taskwarriorcolors.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,37 @@
// ignore_for_file: file_names

import 'package:flutter/material.dart';
import 'package:taskwarrior/widgets/pallete.dart';

class Appcolors {
class TaskWarriorColors {
// Normal Colors
static Color red = Colors.red;
static Color green = Colors.green;
static Color yellow = Colors.yellow;
static Color white = Colors.white;
static Color black = Colors.black;
static Color grey = Colors.grey;
static Color? lightGrey = Colors.grey[600];
static Color purple = Colors.purple;
static Color borderColor = Colors.grey.shade300;
static Color deepPurpleAccent = Colors.deepPurpleAccent;
static Color deepPurple = Colors.deepPurple;

// Dark Theme Color Palette
static Color kprimaryBackgroundColor = Palette.kToDark.shade200;
static Color ksecondaryBackgroundColor =
const Color.fromARGB(255, 48, 46, 46);
static Color kprimaryTextColor = Colors.white;
static Color ksecondaryTextColor = Colors.white;
static Color kprimaryDisabledTextColor = const Color(0xff595f6b);
static Color kdialogBackGroundColor = const Color.fromARGB(255, 25, 25, 25);

// Light Theme Color Palette
static Color kLightPrimaryBackgroundColor = Colors.white;
static Color kLightSecondaryBackgroundColor =
const Color.fromARGB(255, 220, 216, 216);
static Color kLightPrimaryTextColor = Colors.black;
static Color kLightSecondaryTextColor = const Color.fromARGB(255, 48, 46, 46);
static Color kLightPrimaryDisabledTextColor = const Color(0xffACACAB);
static Color kLightDialogBackGroundColor = Colors.white;
}
20 changes: 20 additions & 0 deletions lib/config/taskwarriorfonts.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import 'package:flutter/material.dart';

class TaskWarriorFonts {
// Font weights
static const FontWeight thin = FontWeight.w100;
static const FontWeight extraLight = FontWeight.w200;
static const FontWeight light = FontWeight.w300;
static const FontWeight regular = FontWeight.w400;
static const FontWeight medium = FontWeight.w500;
static const FontWeight semiBold = FontWeight.w600;
static const FontWeight bold = FontWeight.w700;
static const FontWeight extraBold = FontWeight.w800;
static const FontWeight black = FontWeight.w900;

// Font sizes
static const double fontSizeSmall = 12.0;
static const double fontSizeMedium = 16.0;
static const double fontSizeLarge = 20.0;
static const double fontSizeExtraLarge = 24.0;
}
5 changes: 4 additions & 1 deletion lib/config/theme_switcher_clipper.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// ignore_for_file: library_private_types_in_public_api

import 'package:flutter/material.dart';
import 'package:taskwarrior/config/taskwarriorcolors.dart';

class ThemeSwitcherClipper extends StatefulWidget {
final bool isDarkMode;
Expand Down Expand Up @@ -36,7 +37,9 @@ class _ThemeSwitcherClipperState extends State<ThemeSwitcherClipper> {
child: Icon(
widget.isDarkMode ? Icons.dark_mode : Icons.light_mode,
key: UniqueKey(),
color: widget.isDarkMode ? Colors.white : Colors.black,
color: widget.isDarkMode
? TaskWarriorColors.white
: TaskWarriorColors.black,
size: 40,
),
)),
Expand Down
4 changes: 1 addition & 3 deletions lib/controller/WidgetController.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:get/get.dart'; // Import the GetX package
import 'package:home_widget/home_widget.dart';
// ignore: depend_on_referenced_packages
import 'package:path_provider/path_provider.dart';
import 'package:syncfusion_flutter_charts/charts.dart';
import 'package:taskwarrior/views/home/home.dart';
import 'package:taskwarrior/widgets/taskdetails/profiles_widget.dart';
Expand Down Expand Up @@ -36,7 +34,7 @@ class WidgetController extends GetxController {
storageWidget = StorageWidget.of(context!); // Use Get.context from GetX
var currentProfile = ProfilesWidget.of(context!).currentProfile;

baseDirectory = await getApplicationDocumentsDirectory();
baseDirectory = ProfilesWidget.of(context!).getBaseDirectory();
storage =
Storage(Directory('${baseDirectory!.path}/profiles/$currentProfile'));

Expand Down
85 changes: 45 additions & 40 deletions lib/drawer/filter_drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';

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

bool isSaved = false;
var tileColor = AppSettings.isDarkMode
? const Color.fromARGB(255, 48, 46, 46)
: const Color.fromARGB(255, 220, 216, 216);
? TaskWarriorColors.ksecondaryBackgroundColor
: TaskWarriorColors.kLightPrimaryBackgroundColor;
late TutorialCoachMark tutorialCoachMark;

void _initFilterDrawerTour() {
Expand All @@ -42,7 +44,7 @@ class _FilterDrawerState extends State<FilterDrawer> {
filterTagKey: filterTagKey,
sortByKey: sortByKey,
),
colorShadow: Colors.black,
colorShadow: TaskWarriorColors.black,
paddingFocus: 10,
opacityShadow: 1.00,
hideSkip: true,
Expand Down Expand Up @@ -83,8 +85,11 @@ class _FilterDrawerState extends State<FilterDrawer> {
var storageWidget = StorageWidget.of(context);
return Drawer(
backgroundColor: AppSettings.isDarkMode
? Color.fromARGB(255, 29, 29, 29)
: Colors.white,
? TaskWarriorColors.kprimaryBackgroundColor
: TaskWarriorColors.kLightPrimaryBackgroundColor,
surfaceTintColor: AppSettings.isDarkMode
? TaskWarriorColors.kprimaryBackgroundColor
: TaskWarriorColors.kLightPrimaryBackgroundColor,
child: SafeArea(
child: Padding(
padding: const EdgeInsets.all(8),
Expand All @@ -103,11 +108,11 @@ class _FilterDrawerState extends State<FilterDrawer> {
child: Text(
'Apply Filters',
style: GoogleFonts.poppins(
fontWeight: FontWeight.bold,
fontWeight: TaskWarriorFonts.bold,
color: (AppSettings.isDarkMode
? Colors.white
: Color.fromARGB(255, 48, 46, 46)),
fontSize: 25),
? TaskWarriorColors.kprimaryTextColor
: TaskWarriorColors.kLightPrimaryTextColor),
fontSize: TaskWarriorFonts.fontSizeExtraLarge),
),
),
),
Expand All @@ -120,7 +125,7 @@ class _FilterDrawerState extends State<FilterDrawer> {
decoration: BoxDecoration(
color: tileColor,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey.shade300),
border: Border.all(color: TaskWarriorColors.borderColor),
),
child: ListTile(
contentPadding: EdgeInsets.only(
Expand All @@ -134,31 +139,31 @@ class _FilterDrawerState extends State<FilterDrawer> {
TextSpan(
text: 'Status : ',
style: GoogleFonts.poppins(
fontWeight: FontWeight.bold,
fontSize: 15,
fontWeight: TaskWarriorFonts.bold,
fontSize: TaskWarriorFonts.fontSizeMedium,
color: AppSettings.isDarkMode
? Colors.white
: Colors.black,
? TaskWarriorColors.white
: TaskWarriorColors.black,
),
),
TextSpan(
text: widget.filters.pendingFilter
? 'pending'
: 'completed',
style: GoogleFonts.poppins(
fontSize: 15,
fontSize: TaskWarriorFonts.fontSizeMedium,
color: AppSettings.isDarkMode
? Colors.white
: Colors.black,
? TaskWarriorColors.white
: TaskWarriorColors.black,
),
),
],
),
),
onTap: widget.filters.togglePendingFilter,
textColor: AppSettings.isDarkMode
? Colors.white
: Color.fromARGB(255, 48, 46, 46),
? TaskWarriorColors.kprimaryTextColor
: TaskWarriorColors.kLightSecondaryTextColor,
),
),
const Divider(
Expand All @@ -171,7 +176,7 @@ class _FilterDrawerState extends State<FilterDrawer> {
decoration: BoxDecoration(
color: tileColor,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey.shade300),
border: Border.all(color: TaskWarriorColors.borderColor),
),
child: ProjectsColumn(
widget.filters.projects,
Expand All @@ -189,7 +194,7 @@ class _FilterDrawerState extends State<FilterDrawer> {
decoration: BoxDecoration(
color: tileColor,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey.shade300),
border: Border.all(color: TaskWarriorColors.borderColor),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
Expand All @@ -203,10 +208,10 @@ class _FilterDrawerState extends State<FilterDrawer> {
'Filter Tag By:',
style: GoogleFonts.poppins(
color: (AppSettings.isDarkMode
? Colors.white
: Color.fromARGB(255, 48, 46, 46)),
? TaskWarriorColors.kprimaryTextColor
: TaskWarriorColors.kLightSecondaryTextColor),
//
fontSize: 18),
fontSize: TaskWarriorFonts.fontSizeLarge),
//textAlign: TextAlign.right,
),
),
Expand All @@ -233,7 +238,7 @@ class _FilterDrawerState extends State<FilterDrawer> {
decoration: BoxDecoration(
color: tileColor,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey.shade300),
border: Border.all(color: TaskWarriorColors.borderColor),
),
//height: 30,
child: Column(
Expand All @@ -247,9 +252,9 @@ class _FilterDrawerState extends State<FilterDrawer> {
'Sort By',
style: GoogleFonts.poppins(
color: (AppSettings.isDarkMode
? Colors.white
: Color.fromARGB(255, 48, 46, 46)),
fontSize: 18),
? TaskWarriorColors.kprimaryTextColor
: TaskWarriorColors.kLightPrimaryTextColor),
fontSize: TaskWarriorFonts.fontSizeLarge),
// textAlign: TextAlign.right,
),
),
Expand Down Expand Up @@ -292,11 +297,12 @@ class _FilterDrawerState extends State<FilterDrawer> {
},
labelStyle: GoogleFonts.poppins(
color: AppSettings.isDarkMode
? Colors.black
: Colors.white),
? TaskWarriorColors.black
: TaskWarriorColors.white),
backgroundColor: AppSettings.isDarkMode
? Color.fromARGB(255, 220, 216, 216)
: Color.fromARGB(255, 48, 46, 46),
? TaskWarriorColors
.kLightSecondaryBackgroundColor
: TaskWarriorColors.ksecondaryBackgroundColor,
),
],
),
Expand All @@ -307,11 +313,10 @@ class _FilterDrawerState extends State<FilterDrawer> {
Container(
width: 200,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: AppSettings.isDarkMode
? Color.fromARGB(255, 220, 216, 216)
: Color.fromARGB(255, 48, 46, 46),
),
borderRadius: BorderRadius.circular(10),
color: AppSettings.isDarkMode
? TaskWarriorColors.kLightSecondaryBackgroundColor
: TaskWarriorColors.ksecondaryBackgroundColor),
child: TextButton(
onPressed: () {
if (storageWidget.selectedSort.endsWith('+') ||
Expand All @@ -324,10 +329,10 @@ class _FilterDrawerState extends State<FilterDrawer> {
child: Text(
'Reset Sort',
style: GoogleFonts.poppins(
fontSize: 15,
fontSize: TaskWarriorFonts.fontSizeMedium,
color: AppSettings.isDarkMode
? Color.fromARGB(255, 48, 46, 46)
: Colors.white),
? TaskWarriorColors.kLightSecondaryTextColor
: TaskWarriorColors.ksecondaryTextColor),
)),
),
const Divider(
Expand Down
9 changes: 5 additions & 4 deletions lib/drawer/filter_drawer_tour.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:taskwarrior/config/taskwarriorcolors.dart';
import 'package:tutorial_coach_mark/tutorial_coach_mark.dart';

List<TargetFocus> filterDrawer({
Expand Down Expand Up @@ -31,7 +32,7 @@ List<TargetFocus> filterDrawer({
"Filter tasks based on their completion status",
textAlign: TextAlign.center,
style: GoogleFonts.poppins(
color: Colors.white,
color: TaskWarriorColors.white,
),
),
],
Expand Down Expand Up @@ -64,7 +65,7 @@ List<TargetFocus> filterDrawer({
"Filter tasks based on the projects",
textAlign: TextAlign.center,
style: GoogleFonts.poppins(
color: Colors.white,
color: TaskWarriorColors.white,
),
),
],
Expand Down Expand Up @@ -97,7 +98,7 @@ List<TargetFocus> filterDrawer({
"Toggle between AND and OR tag union types",
textAlign: TextAlign.center,
style: GoogleFonts.poppins(
color: Colors.white,
color: TaskWarriorColors.white,
),
),
],
Expand Down Expand Up @@ -130,7 +131,7 @@ List<TargetFocus> filterDrawer({
"Sort tasks based on time of creation, urgency, due date, start date, etc.",
textAlign: TextAlign.center,
style: GoogleFonts.poppins(
color: Colors.white,
color: TaskWarriorColors.white,
),
),
],
Expand Down
Loading

0 comments on commit 4061ee0

Please sign in to comment.