Skip to content

Commit

Permalink
Merge pull request #187 from Pavel401/settings
Browse files Browse the repository at this point in the history
added settings page and changed the fonts
  • Loading branch information
Pavel401 authored Sep 13, 2023
2 parents deef4c1 + d28df98 commit 3a4ba9e
Show file tree
Hide file tree
Showing 30 changed files with 369 additions and 262 deletions.
10 changes: 5 additions & 5 deletions android/app/src/main/res/layout/taskwarrior_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
android:layout_height="wrap_content"
android:text="TaskWarrior"
android:textSize="20sp"
android:textStyle="bold"
android:GoogleFonts.poppins="bold"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="12dp"/>
Expand All @@ -30,7 +30,7 @@
android:layout_height="wrap_content"
android:text="Pending Tasks"
android:textSize="18sp"
android:textStyle="bold"
android:GoogleFonts.poppins="bold"
android:layout_below="@id/taskWarriorText"
android:layout_centerHorizontal="true"
android:layout_marginTop="8dp"/>
Expand All @@ -52,7 +52,7 @@
android:layout_height="wrap_content"
android:text="Title"
android:textSize="16sp"
android:textStyle="bold" />
android:GoogleFonts.poppins="bold" />

<TextView
android:id="@+id/idTvDate"
Expand Down Expand Up @@ -82,7 +82,7 @@
android:layout_height="wrap_content"
android:text="Title"
android:textSize="16sp"
android:textStyle="bold" />
android:GoogleFonts.poppins="bold" />

<TextView
android:id="@+id/idTvDate2"
Expand Down Expand Up @@ -113,7 +113,7 @@
android:layout_height="wrap_content"
android:text="Title"
android:textSize="16sp"
android:textStyle="bold" />
android:GoogleFonts.poppins="bold" />

<TextView
android:id="@+id/idTvDate3"
Expand Down
21 changes: 10 additions & 11 deletions lib/drawer/filter_drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class FilterDrawer extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 0.0),
child: Text(
'Apply Filters',
style: TextStyle(
style: GoogleFonts.poppins(
fontWeight: FontWeight.bold,
color: (AppSettings.isDarkMode
? Colors.white
Expand All @@ -68,7 +68,7 @@ class FilterDrawer extends StatelessWidget {
children: <TextSpan>[
TextSpan(
text: 'Status : ',
style: GoogleFonts.firaMono(
style: GoogleFonts.poppins(
fontWeight: FontWeight.bold,
fontSize: 15,
color: AppSettings.isDarkMode
Expand All @@ -78,7 +78,7 @@ class FilterDrawer extends StatelessWidget {
),
TextSpan(
text: filters.pendingFilter ? 'pending' : 'completed',
style: GoogleFonts.firaMono(
style: GoogleFonts.poppins(
fontSize: 15,
color: AppSettings.isDarkMode
? Colors.white
Expand Down Expand Up @@ -132,11 +132,11 @@ class FilterDrawer extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 0.0),
child: Text(
'Filter Tag By:',
style: TextStyle(
style: GoogleFonts.poppins(
color: (AppSettings.isDarkMode
? Colors.white
: Color.fromARGB(255, 48, 46, 46)),
fontFamily: GoogleFonts.firaMono().fontFamily,
//
fontSize: 18),
//textAlign: TextAlign.right,
),
Expand Down Expand Up @@ -175,11 +175,10 @@ class FilterDrawer extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 0.0),
child: Text(
'Sort By',
style: TextStyle(
style: GoogleFonts.poppins(
color: (AppSettings.isDarkMode
? Colors.white
: Color.fromARGB(255, 48, 46, 46)),
fontFamily: GoogleFonts.firaMono().fontFamily,
fontSize: 18),
//textAlign: TextAlign.right,
),
Expand Down Expand Up @@ -221,7 +220,7 @@ class FilterDrawer extends StatelessWidget {
storageWidget.selectSort('$sort+');
}
},
labelStyle: TextStyle(
labelStyle: GoogleFonts.poppins(
color: AppSettings.isDarkMode
? Colors.black
: Colors.white),
Expand Down Expand Up @@ -254,7 +253,7 @@ class FilterDrawer extends StatelessWidget {
},
child: Text(
'Reset Sort',
style: TextStyle(
style: GoogleFonts.poppins(
fontSize: 15,
color: AppSettings.isDarkMode
? Color.fromARGB(255, 48, 46, 46)
Expand Down Expand Up @@ -312,13 +311,13 @@ class FilterDrawer extends StatelessWidget {
// FilterChip(
// onSelected: (_) => filters.toggleTagUnion(),
// label: Text(filters.tagUnion ? 'OR' : 'AND',
// style: GoogleFonts.firaMono())),
// style: GoogleFonts.poppins())),
// for (var entry in filters.tags.entries)
// FilterChip(
// onSelected: (_) => filters.toggleTagFilter(entry.key),
// label: Text(
// entry.value.display,
// style: GoogleFonts.firaMono(
// style: GoogleFonts.poppins(
// fontWeight: entry.value.selected ? FontWeight.w700 : null,
// ),
// ),
Expand Down
19 changes: 17 additions & 2 deletions lib/drawer/nav_drawer.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';

import 'package:taskwarrior/config/app_settings.dart';
import 'package:taskwarrior/model/storage/storage_widget.dart';
import 'package:taskwarrior/routes/pageroute.dart';
import 'package:taskwarrior/views/about/about.dart';
import 'package:taskwarrior/views/reports/reports_home.dart';
import 'package:taskwarrior/views/settings/settings.dart';

class NavDrawer extends StatefulWidget {
final InheritedStorage storageWidget;
Expand Down Expand Up @@ -33,9 +35,9 @@ class _NavDrawerState extends State<NavDrawer> {
tileColor: AppSettings.isDarkMode ? Colors.black : Colors.white,
textColor: AppSettings.isDarkMode ? Colors.white : Colors.black,
contentPadding: const EdgeInsets.only(top: 40, left: 10),
title: const Text(
title: Text(
'Menu',
style: TextStyle(
style: GoogleFonts.poppins(
fontSize: 25,
fontWeight: FontWeight.bold,
),
Expand Down Expand Up @@ -120,6 +122,19 @@ class _NavDrawerState extends State<NavDrawer> {
},
title: const Text("About"),
),
ListTile(
tileColor: AppSettings.isDarkMode ? Colors.black : Colors.white,
textColor: AppSettings.isDarkMode ? Colors.white : Colors.black,
leading: Icon(
Icons.settings,
color: AppSettings.isDarkMode ? Colors.white : Colors.black,
),
onTap: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (context) => const SettingsPage()));
},
title: const Text("Settings"),
),
],
));
}
Expand Down
25 changes: 18 additions & 7 deletions lib/model/storage/storage_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import 'dart:io';

import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:google_fonts/google_fonts.dart';

import 'package:loggy/loggy.dart';

Expand Down Expand Up @@ -267,20 +269,26 @@ class _StorageWidgetState extends State<StorageWidget> {
),
child: Container(
padding: const EdgeInsets.all(16.0),
child: const Column(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
CircularProgressIndicator(),
SizedBox(height: 16.0),
const CircularProgressIndicator(),
const SizedBox(height: 16.0),
Text(
"Syncing",
style: TextStyle(
style: GoogleFonts.poppins(
fontSize: 18.0,
fontWeight: FontWeight.bold,
),
),
SizedBox(height: 8.0),
Text("Please wait..."),
const SizedBox(height: 8.0),
Text(
"Please wait...",
style: GoogleFonts.poppins(
fontSize: 12.0,
fontWeight: FontWeight.normal,
),
),
],
),
),
Expand All @@ -296,7 +304,7 @@ class _StorageWidgetState extends State<StorageWidget> {
setState(() {});

if (isDialogNeeded) {
Navigator.pop(context);
Get.back();
}

ScaffoldMessenger.of(context).showSnackBar(
Expand All @@ -306,6 +314,9 @@ class _StorageWidgetState extends State<StorageWidget> {
);
}
} catch (e, trace) {
if (isDialogNeeded) {
Get.back();
}
logError(e, trace);
}
}
Expand Down
16 changes: 8 additions & 8 deletions lib/services/task_details.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class _DetailRouteState extends State<DetailRoute> {
backgroundColor: Palette.kToDark,
title: Text(
'id: ${(modify.id == 0) ? '-' : modify.id}',
style: GoogleFonts.firaMono(color: Colors.white),
style: GoogleFonts.poppins(color: Colors.white),
),
),
body: Padding(
Expand Down Expand Up @@ -124,7 +124,7 @@ class _DetailRouteState extends State<DetailRoute> {
' new: ${entry.value['new']}')
.toList()
.join('\n'),
style: GoogleFonts.firaMono(),
style: GoogleFonts.poppins(),
),
),
actions: [
Expand Down Expand Up @@ -291,7 +291,7 @@ class AttributeWidget extends StatelessWidget {
children: [
Text(
'$name:'.padRight(13),
style: GoogleFonts.firaMono(
style: GoogleFonts.poppins(
fontWeight: FontWeight.bold,
fontSize: 15,
color:
Expand All @@ -300,7 +300,7 @@ class AttributeWidget extends StatelessWidget {
),
Text(
localValue?.toString() ?? "not selected",
style: GoogleFonts.firaMono(
style: GoogleFonts.poppins(
fontSize: 15,
color:
AppSettings.isDarkMode ? Colors.white : Colors.black,
Expand Down Expand Up @@ -345,7 +345,7 @@ class TagsWidget extends StatelessWidget {
children: <TextSpan>[
TextSpan(
text: '$name:'.padRight(13),
style: GoogleFonts.firaMono(
style: GoogleFonts.poppins(
fontWeight: FontWeight.bold,
fontSize: 15,
color: AppSettings.isDarkMode
Expand All @@ -356,7 +356,7 @@ class TagsWidget extends StatelessWidget {
TextSpan(
text:
'${(value as ListBuilder?)?.build() ?? 'not selected'}',
style: GoogleFonts.firaMono(
style: GoogleFonts.poppins(
fontSize: 15,
color: AppSettings.isDarkMode
? Colors.white
Expand All @@ -368,7 +368,7 @@ class TagsWidget extends StatelessWidget {
),
// Text(
// '${'$name: '}${(value as ListBuilder?)?.build()}',
// style: GoogleFonts.firaMono(),
// style: GoogleFonts.poppins(),
// ),
],
),
Expand Down Expand Up @@ -410,7 +410,7 @@ class TagsWidget extends StatelessWidget {
// (value == null)
// ? '${'$name:'.padRight(13)}null'
// : '${'$name:'.padRight(13)}${(value as ListBuilder).length} annotation(s)',
// style: GoogleFonts.firaMono(),
// style: GoogleFonts.poppins(),
// ),
// ],
// ),
Expand Down
Loading

0 comments on commit 3a4ba9e

Please sign in to comment.