Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/app/modules/home/controllers/home_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import 'package:taskwarrior/app/utils/themes/theme_extension.dart';
import 'package:tutorial_coach_mark/tutorial_coach_mark.dart';

class HomeController extends GetxController {
static const String noProjectValue = " (No Project) ";
final SplashController splashController = Get.find<SplashController>();
late Storage storage;
final RxBool pendingFilter = false.obs;
Expand Down Expand Up @@ -262,6 +263,9 @@ class HomeController extends GetxController {

if (projectFilter.value.isNotEmpty) {
queriedTasks.value = queriedTasks.where((task) {
if (projectFilter.value == noProjectValue) {
return task.project == null || task.project!.isEmpty;
}
if (task.project == null) {
return false;
} else {
Expand Down
55 changes: 45 additions & 10 deletions lib/app/modules/home/views/project_column_home_page.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';

import 'package:taskwarrior/app/modules/home/controllers/home_controller.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:taskwarrior/app/utils/app_settings/app_settings.dart';
import 'package:taskwarrior/app/utils/constants/taskwarrior_fonts.dart';
Expand Down Expand Up @@ -63,24 +64,58 @@ class ProjectsColumn extends StatelessWidget {
],
),
),
Padding(
padding: const EdgeInsets.only(left: 10, right: 10, top: 10),
GestureDetector(
onTap: () => callback(''),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(SentenceManager(
currentLanguage: AppSettings.selectedLanguage).sentences.allProjects,
style: TextStyle(
fontFamily: FontFamily.poppins,
fontSize: TaskWarriorFonts.fontSizeSmall,
color: tColors.primaryTextColor,
)),
Radio(
activeColor: tColors.primaryTextColor,
focusColor: tColors.secondaryTextColor,
toggleable: true,
value: '',
groupValue: projectFilter,
onChanged: (_) => callback(''),
),
Text(
SentenceManager(currentLanguage: AppSettings.selectedLanguage)
.sentences
.allProjects,
style: GoogleFonts.poppins(
color: tColors.primaryTextColor,
),
),
],
),
),
GestureDetector(
onTap: () => callback(HomeController.noProjectValue),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Radio(
activeColor: tColors.primaryTextColor,
focusColor: tColors.secondaryTextColor,
toggleable: true,
value: HomeController.noProjectValue,
groupValue: projectFilter,
onChanged: (_) => callback(HomeController.noProjectValue),
),
Text(
SentenceManager(currentLanguage: AppSettings.selectedLanguage)
.sentences
.noProject,
style: GoogleFonts.poppins(
color: tColors.primaryTextColor,
),
),
],
),
),
if (projects.isNotEmpty)
...projects.entries
.where((entry) => entry.value.parent == null)
.where((entry) =>
entry.value.parent == null && entry.key.isNotEmpty)
.map((entry) => ProjectTile(
project: entry.key,
projects: projects,
Expand Down
31 changes: 22 additions & 9 deletions lib/app/modules/home/views/project_column_taskc.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:taskwarrior/app/modules/home/controllers/home_controller.dart';
import 'package:taskwarrior/app/utils/app_settings/app_settings.dart';
import 'package:taskwarrior/app/utils/constants/taskwarrior_fonts.dart';
import 'package:taskwarrior/app/utils/gen/fonts.gen.dart';
Expand Down Expand Up @@ -65,17 +66,27 @@ class ProjectColumnTaskc extends StatelessWidget {
),
),
ProjectTileTaskc(
project: SentenceManager(
project: '',
projectFilter: projectFilter,
callback: callback,
displayName: SentenceManager(
currentLanguage: AppSettings.selectedLanguage,
).sentences.allProjects,
).sentences.allProjects),
ProjectTileTaskc(
project: HomeController.noProjectValue,
projectFilter: projectFilter,
callback: callback),
callback: (val) => callback(val),
displayName: SentenceManager(
currentLanguage: AppSettings.selectedLanguage,
).sentences.noProject),
if (projects.isNotEmpty)
...projects.map((entry) => ProjectTileTaskc(
project: entry,
projectFilter: projectFilter,
callback: callback,
))
...projects
.where((entry) => entry.isNotEmpty)
.map((entry) => ProjectTileTaskc(
project: entry,
projectFilter: projectFilter,
callback: callback,
))
else
Column(
children: [
Expand Down Expand Up @@ -105,11 +116,13 @@ class ProjectTileTaskc extends StatelessWidget {
required this.project,
required this.projectFilter,
required this.callback,
this.displayName,
});

final String project;
final String projectFilter;
final void Function(String) callback;
final String? displayName;

@override
Widget build(BuildContext context) {
Expand All @@ -126,7 +139,7 @@ class ProjectTileTaskc extends StatelessWidget {
onChanged: (_) => callback(project),
),
Text(
project,
displayName ?? project,
style: TextStyle(
color: tColors.primaryTextColor,
),
Expand Down
2 changes: 2 additions & 0 deletions lib/app/utils/language/bengali_sentences.dart
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,8 @@ class BengaliSentences extends Sentences {
@override
String get noProjectsFound => 'কোনো প্রকল্প পাওয়া যায়নি';
@override
String get noProject => 'কোন প্রকল্প নেই';
@override
String get project => 'প্রকল্প';

@override
Expand Down
2 changes: 2 additions & 0 deletions lib/app/utils/language/english_sentences.dart
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,8 @@ class EnglishSentences extends Sentences {
@override
String get noProjectsFound => 'No Projects Found';
@override
String get noProject => 'No Project';
@override
String get project => 'Project';

@override
Expand Down
2 changes: 2 additions & 0 deletions lib/app/utils/language/french_sentences.dart
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,8 @@ class FrenchSentences extends Sentences {
@override
String get noProjectsFound => 'Aucun projet trouvé';
@override
String get noProject => 'Aucun Projet';
@override
String get project => 'Projet';

@override
Expand Down
2 changes: 2 additions & 0 deletions lib/app/utils/language/german_sentences.dart
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,8 @@ class GermanSentences extends Sentences {
@override
String get noProjectsFound => 'Keine Projekte gefunden';
@override
String get noProject => 'Kein Projekt';
@override
String get project => 'Projekt';

@override
Expand Down
2 changes: 2 additions & 0 deletions lib/app/utils/language/hindi_sentences.dart
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,8 @@ class HindiSentences extends Sentences {
@override
String get noProjectsFound => 'कोई परियोजना नहीं मिली';
@override
String get noProject => 'कोई प्रोजेक्ट नहीं';
@override
String get project => 'परियोजना';

@override
Expand Down
2 changes: 2 additions & 0 deletions lib/app/utils/language/marathi_sentences.dart
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,8 @@ class MarathiSentences extends Sentences {
@override
String get noProjectsFound => 'प्रकल्प सापडले नाहीत';
@override
String get noProject => 'कोणताही प्रकल्प नाही';
@override
String get project => 'प्रकल्प';

@override
Expand Down
1 change: 1 addition & 0 deletions lib/app/utils/language/sentences.dart
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ abstract class Sentences {

String get allProjects;
String get noProjectsFound;
String get noProject;
String get project;

String get select;
Expand Down
2 changes: 2 additions & 0 deletions lib/app/utils/language/spanish_sentences.dart
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,8 @@ class SpanishSentences extends Sentences {
@override
String get noProjectsFound => 'No se encontraron proyectos';
@override
String get noProject => 'Sin Proyecto';
@override
String get project => 'Proyecto';

@override
Expand Down
2 changes: 2 additions & 0 deletions lib/app/utils/language/urdu_sentences.dart
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,8 @@ class UrduSentences extends Sentences {
@override
String get noProjectsFound => 'کوئی پراجیکٹ نہیں ملا';
@override
String get noProject => 'کوئی پروجیکٹ نہیں';
@override
String get project => 'پراجیکٹ';

@override
Expand Down