Skip to content

Commit

Permalink
Merge pull request #303 from its-me-abhishek/main
Browse files Browse the repository at this point in the history
Added a global class to manage Font weights and Font sizes
  • Loading branch information
Pavel401 authored Feb 21, 2024
2 parents 35f58f4 + efca87c commit 73b7c01
Show file tree
Hide file tree
Showing 27 changed files with 182 additions and 126 deletions.
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;
}
17 changes: 9 additions & 8 deletions lib/drawer/filter_drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ 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 Down Expand Up @@ -107,11 +108,11 @@ class _FilterDrawerState extends State<FilterDrawer> {
child: Text(
'Apply Filters',
style: GoogleFonts.poppins(
fontWeight: FontWeight.bold,
fontWeight: TaskWarriorFonts.bold,
color: (AppSettings.isDarkMode
? TaskWarriorColors.kprimaryTextColor
: TaskWarriorColors.kLightPrimaryTextColor),
fontSize: 25),
fontSize: TaskWarriorFonts.fontSizeExtraLarge),
),
),
),
Expand All @@ -138,8 +139,8 @@ 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
? TaskWarriorColors.white
: TaskWarriorColors.black,
Expand All @@ -150,7 +151,7 @@ class _FilterDrawerState extends State<FilterDrawer> {
? 'pending'
: 'completed',
style: GoogleFonts.poppins(
fontSize: 15,
fontSize: TaskWarriorFonts.fontSizeMedium,
color: AppSettings.isDarkMode
? TaskWarriorColors.white
: TaskWarriorColors.black,
Expand Down Expand Up @@ -210,7 +211,7 @@ class _FilterDrawerState extends State<FilterDrawer> {
? TaskWarriorColors.kprimaryTextColor
: TaskWarriorColors.kLightSecondaryTextColor),
//
fontSize: 18),
fontSize: TaskWarriorFonts.fontSizeLarge),
//textAlign: TextAlign.right,
),
),
Expand Down Expand Up @@ -253,7 +254,7 @@ class _FilterDrawerState extends State<FilterDrawer> {
color: (AppSettings.isDarkMode
? TaskWarriorColors.kprimaryTextColor
: TaskWarriorColors.kLightPrimaryTextColor),
fontSize: 18),
fontSize: TaskWarriorFonts.fontSizeLarge),
// textAlign: TextAlign.right,
),
),
Expand Down Expand Up @@ -328,7 +329,7 @@ class _FilterDrawerState extends State<FilterDrawer> {
child: Text(
'Reset Sort',
style: GoogleFonts.poppins(
fontSize: 15,
fontSize: TaskWarriorFonts.fontSizeMedium,
color: AppSettings.isDarkMode
? TaskWarriorColors.kLightSecondaryTextColor
: TaskWarriorColors.ksecondaryTextColor),
Expand Down
7 changes: 4 additions & 3 deletions lib/drawer/nav_drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'package:shared_preferences/shared_preferences.dart';
import 'package:sizer/sizer.dart';
import 'package:taskwarrior/config/app_settings.dart';
import 'package:taskwarrior/config/taskwarriorcolors.dart';
import 'package:taskwarrior/config/taskwarriorfonts.dart';
import 'package:taskwarrior/model/storage/storage_widget.dart';
import 'package:taskwarrior/views/about/about.dart';
import 'package:taskwarrior/views/profile/profile.dart';
Expand Down Expand Up @@ -55,8 +56,8 @@ class _NavDrawerState extends State<NavDrawer> {
Text(
'Menu',
style: TextStyle(
fontSize: 25,
fontWeight: FontWeight.bold,
fontSize: TaskWarriorFonts.fontSizeExtraLarge,
fontWeight: TaskWarriorFonts.bold,
color: AppSettings.isDarkMode
? TaskWarriorColors.white
: TaskWarriorColors.black,
Expand Down Expand Up @@ -195,7 +196,7 @@ class _NavDrawerState extends State<NavDrawer> {
color: AppSettings.isDarkMode
? TaskWarriorColors.white
: TaskWarriorColors.black,
fontSize: 18,
fontSize: TaskWarriorFonts.fontSizeMedium,
),
),
],
Expand Down
9 changes: 5 additions & 4 deletions lib/model/storage/storage_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import 'package:google_fonts/google_fonts.dart';
import 'package:loggy/loggy.dart';
import 'package:taskwarrior/config/app_settings.dart';
import 'package:taskwarrior/config/taskwarriorcolors.dart';
import 'package:taskwarrior/config/taskwarriorfonts.dart';

import 'package:taskwarrior/model/json.dart';
import 'package:taskwarrior/model/storage.dart';
Expand Down Expand Up @@ -286,16 +287,16 @@ class _StorageWidgetState extends State<StorageWidget> {
Text(
"Syncing",
style: GoogleFonts.poppins(
fontSize: 18.0,
fontWeight: FontWeight.bold,
fontSize: TaskWarriorFonts.fontSizeLarge,
fontWeight: TaskWarriorFonts.bold,
),
),
const SizedBox(height: 8.0),
Text(
"Please wait...",
style: GoogleFonts.poppins(
fontSize: 12.0,
fontWeight: FontWeight.normal,
fontSize: TaskWarriorFonts.fontSizeSmall,
fontWeight: TaskWarriorFonts.regular,
),
),
],
Expand Down
5 changes: 3 additions & 2 deletions lib/services/task_details.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'package:intl/intl.dart';

import 'package:taskwarrior/config/app_settings.dart';
import 'package:taskwarrior/config/taskwarriorcolors.dart';
import 'package:taskwarrior/config/taskwarriorfonts.dart';
import 'package:taskwarrior/model/storage/storage_widget.dart';
import 'package:taskwarrior/views/home/home.dart';
import 'package:taskwarrior/widgets/pallete.dart';
Expand Down Expand Up @@ -440,8 +441,8 @@ class TagsWidget extends StatelessWidget {
TextSpan(
text: '$name:'.padRight(13),
style: GoogleFonts.poppins(
fontWeight: FontWeight.bold,
fontSize: 15,
fontWeight: TaskWarriorFonts.bold,
fontSize: TaskWarriorFonts.fontSizeMedium,
color: AppSettings.isDarkMode
? TaskWarriorColors.white
: TaskWarriorColors.black,
Expand Down
5 changes: 3 additions & 2 deletions lib/services/task_list_tem.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:google_fonts/google_fonts.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:taskwarrior/config/app_settings.dart';
import 'package:taskwarrior/config/taskwarriorcolors.dart';
import 'package:taskwarrior/config/taskwarriorfonts.dart';
import 'package:taskwarrior/model/json.dart';
import 'package:taskwarrior/widgets/taskw.dart';

Expand Down Expand Up @@ -141,7 +142,7 @@ class _TaskListItemState extends State<TaskListItem> {
overflow: TextOverflow.ellipsis,
style: GoogleFonts.poppins(
color: dimColor,
fontSize: 12,
fontSize: TaskWarriorFonts.fontSizeSmall,
),
),
),
Expand Down Expand Up @@ -198,7 +199,7 @@ class _TaskListItemState extends State<TaskListItem> {
overflow: TextOverflow.ellipsis,
style: GoogleFonts.poppins(
color: dimColor,
fontSize: 12,
fontSize: TaskWarriorFonts.fontSizeSmall,
),
),
),
Expand Down
11 changes: 8 additions & 3 deletions lib/taskserver/ntaskserver.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:loggy/loggy.dart';
import 'package:taskwarrior/config/taskwarriorcolors.dart';
import 'package:taskwarrior/config/taskwarriorfonts.dart';
import 'package:taskwarrior/widgets/taskdetails/profiles_widget.dart';
// ignore_for_file: use_build_context_synchronously

Expand Down Expand Up @@ -321,12 +322,16 @@ class _ManageTaskServerState extends State<ManageTaskServer> {
Text(
"Configure TaskServer",
style: GoogleFonts.poppins(
color: TaskWarriorColors.white, fontSize: 18),
color: TaskWarriorColors.white,
fontSize: TaskWarriorFonts.fontSizeLarge,
),
),
Text(
alias ?? profile,
style: GoogleFonts.poppins(
color: TaskWarriorColors.white, fontSize: 12),
color: TaskWarriorColors.white,
fontSize: TaskWarriorFonts.fontSizeSmall,
),
),
],
),
Expand Down Expand Up @@ -425,7 +430,7 @@ class _ManageTaskServerState extends State<ManageTaskServer> {
Text(
'Configure TaskRc',
style: TextStyle(
fontWeight: FontWeight.bold,
fontWeight: TaskWarriorFonts.bold,
color: AppSettings.isDarkMode
? TaskWarriorColors.white
: TaskWarriorColors.black,
Expand Down
13 changes: 7 additions & 6 deletions lib/views/Onboarding/onboarding_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:taskwarrior/config/taskwarriorcolors.dart';
import 'package:taskwarrior/config/taskwarriorfonts.dart';
import 'package:taskwarrior/controller/onboarding_controller.dart';
import 'package:taskwarrior/views/Onboarding/Model/onboarding_contents.dart';
import 'package:taskwarrior/views/Onboarding/Components/size_config.dart';
Expand Down Expand Up @@ -93,7 +94,7 @@ class _OnboardingScreenState extends State<OnboardingScreen> {
content.title,
textAlign: TextAlign.center,
style: GoogleFonts.poppins(
fontWeight: FontWeight.w600,
fontWeight: TaskWarriorFonts.semiBold,
fontSize: (width <= 550) ? 30 : 35,
),
),
Expand All @@ -104,7 +105,7 @@ class _OnboardingScreenState extends State<OnboardingScreen> {
Text(
content.desc,
style: GoogleFonts.poppins(
fontWeight: FontWeight.w300,
fontWeight: TaskWarriorFonts.light,
fontSize: (width <= 550) ? 17 : 17,
),
textAlign: TextAlign.center,
Expand Down Expand Up @@ -162,7 +163,7 @@ class _OnboardingScreenState extends State<OnboardingScreen> {
child: Text(
"Start",
style: GoogleFonts.poppins(
fontWeight: FontWeight.w300,
fontWeight: TaskWarriorFonts.light,
color: TaskWarriorColors.white,
fontSize: (width <= 550) ? 17 : 17,
),
Expand All @@ -184,14 +185,14 @@ class _OnboardingScreenState extends State<OnboardingScreen> {
style: TextButton.styleFrom(
elevation: 0,
textStyle: TextStyle(
fontWeight: FontWeight.w600,
fontWeight: TaskWarriorFonts.semiBold,
fontSize: (width <= 550) ? 13 : 17,
),
),
child: Text(
"Skip",
style: GoogleFonts.poppins(
fontWeight: FontWeight.bold,
fontWeight: TaskWarriorFonts.bold,
color: TaskWarriorColors.black,
fontSize: (width <= 550) ? 12 : 12,
),
Expand All @@ -218,7 +219,7 @@ class _OnboardingScreenState extends State<OnboardingScreen> {
child: Text(
"Next",
style: GoogleFonts.poppins(
fontWeight: FontWeight.w300,
fontWeight: TaskWarriorFonts.light,
color: TaskWarriorColors.white,
fontSize: (width <= 550) ? 12 : 12,
),
Expand Down
33 changes: 17 additions & 16 deletions lib/views/about/about.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:package_info_plus/package_info_plus.dart';
import 'package:sizer/sizer.dart';
import 'package:taskwarrior/config/app_settings.dart';
import 'package:taskwarrior/config/taskwarriorcolors.dart';
import 'package:taskwarrior/config/taskwarriorfonts.dart';
import 'package:url_launcher/url_launcher.dart';

class AboutPage extends StatefulWidget {
Expand Down Expand Up @@ -59,8 +60,8 @@ class _AboutPageState extends State<AboutPage> {
Text(
"Taskwarrior",
style: GoogleFonts.poppins(
fontWeight: FontWeight.bold,
fontSize: 18,
fontWeight: TaskWarriorFonts.bold,
fontSize: TaskWarriorFonts.fontSizeLarge,
color: AppSettings.isDarkMode
? TaskWarriorColors.white
: TaskWarriorColors.black,
Expand Down Expand Up @@ -91,8 +92,8 @@ class _AboutPageState extends State<AboutPage> {
TextSpan(
text: 'Version: ',
style: GoogleFonts.poppins(
fontWeight: FontWeight.bold,
fontSize: 15,
fontWeight: TaskWarriorFonts.bold,
fontSize: TaskWarriorFonts.fontSizeMedium,
color: AppSettings.isDarkMode
? TaskWarriorColors.white
: TaskWarriorColors.black,
Expand All @@ -101,7 +102,7 @@ class _AboutPageState extends State<AboutPage> {
TextSpan(
text: appInfoLines[1],
style: GoogleFonts.poppins(
fontSize: 15,
fontSize: TaskWarriorFonts.fontSizeMedium,
color: AppSettings.isDarkMode
? TaskWarriorColors.white
: TaskWarriorColors.black,
Expand All @@ -116,8 +117,8 @@ class _AboutPageState extends State<AboutPage> {
TextSpan(
text: 'Package: ',
style: GoogleFonts.poppins(
fontWeight: FontWeight.bold,
fontSize: 15,
fontWeight: TaskWarriorFonts.bold,
fontSize: TaskWarriorFonts.fontSizeMedium,
color: AppSettings.isDarkMode
? TaskWarriorColors.white
: TaskWarriorColors.black,
Expand All @@ -126,7 +127,7 @@ class _AboutPageState extends State<AboutPage> {
TextSpan(
text: appInfoLines[0],
style: GoogleFonts.poppins(
fontSize: 15,
fontSize: TaskWarriorFonts.fontSizeMedium,
color: AppSettings.isDarkMode
? TaskWarriorColors.white
: TaskWarriorColors.black,
Expand All @@ -149,8 +150,8 @@ class _AboutPageState extends State<AboutPage> {
introduction,
textAlign: TextAlign.center,
style: GoogleFonts.poppins(
fontWeight: FontWeight.w500,
fontSize: 12,
fontWeight: TaskWarriorFonts.medium,
fontSize: TaskWarriorFonts.fontSizeSmall,
color: AppSettings.isDarkMode
? TaskWarriorColors.white
: TaskWarriorColors.black,
Expand Down Expand Up @@ -194,8 +195,8 @@ class _AboutPageState extends State<AboutPage> {
label: Text(
"GitHub",
style: GoogleFonts.poppins(
fontWeight: FontWeight.w500,
fontSize: 12,
fontWeight: TaskWarriorFonts.medium,
fontSize: TaskWarriorFonts.fontSizeSmall,
color: AppSettings.isDarkMode
? TaskWarriorColors.black
: TaskWarriorColors.white,
Expand Down Expand Up @@ -232,8 +233,8 @@ class _AboutPageState extends State<AboutPage> {
label: Text(
"CCExtractor",
style: GoogleFonts.poppins(
fontWeight: FontWeight.w500,
fontSize: 12,
fontWeight: TaskWarriorFonts.medium,
fontSize: TaskWarriorFonts.fontSizeSmall,
color: AppSettings.isDarkMode
? TaskWarriorColors.black
: TaskWarriorColors.white,
Expand All @@ -250,8 +251,8 @@ class _AboutPageState extends State<AboutPage> {
"Eager to enhance this project? Visit our GitHub repository.",
textAlign: TextAlign.center,
style: GoogleFonts.poppins(
fontWeight: FontWeight.w600,
fontSize: 12,
fontWeight: TaskWarriorFonts.semiBold,
fontSize: TaskWarriorFonts.fontSizeSmall,
color: AppSettings.isDarkMode
? TaskWarriorColors.white
: TaskWarriorColors.black,
Expand Down
Loading

0 comments on commit 73b7c01

Please sign in to comment.