Skip to content

Commit

Permalink
Merge pull request #182 from Pavel401/filter-update
Browse files Browse the repository at this point in the history
Visual changes for different parts of the UI
  • Loading branch information
Pavel401 authored Sep 11, 2023
2 parents d117f52 + dde2b8d commit 0e26d51
Show file tree
Hide file tree
Showing 5 changed files with 160 additions and 60 deletions.
31 changes: 24 additions & 7 deletions lib/drawer/filter_drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,30 @@ class FilterDrawer extends StatelessWidget {
border: Border.all(color: Colors.grey.shade300),
),
child: ListTile(
title: Text(
filters.pendingFilter
? 'status : pending'
: 'status : completed',
style: TextStyle(
fontFamily: GoogleFonts.firaMono().fontFamily,
fontSize: 18,
title: RichText(
maxLines: 2,
text: TextSpan(
children: <TextSpan>[
TextSpan(
text: 'Status : ',
style: GoogleFonts.firaMono(
fontWeight: FontWeight.bold,
fontSize: 15,
color: AppSettings.isDarkMode
? Colors.white
: Colors.black,
),
),
TextSpan(
text: filters.pendingFilter ? 'pending' : 'completed',
style: GoogleFonts.firaMono(
fontSize: 15,
color: AppSettings.isDarkMode
? Colors.white
: Colors.black,
),
),
],
),
),
onTap: filters.togglePendingFilter,
Expand Down
6 changes: 3 additions & 3 deletions lib/views/profile/profile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ class _ProfilePageState extends State<ProfilePage> {
return Scaffold(
appBar: AppBar(
backgroundColor: Palette.kToDark.shade200,
title: const Text(
'Profiles',
style: TextStyle(color: Colors.white),
title: Text(
profilesMap.length == 1 ? 'Profile' : 'Profiles',
style: const TextStyle(color: Colors.white),
),
leading: IconButton(
onPressed: () {
Expand Down
10 changes: 9 additions & 1 deletion lib/widgets/profilefunctions/manageprofile.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';

import 'package:tuple/tuple.dart';

Expand Down Expand Up @@ -41,7 +42,14 @@ class ManageProfile extends StatelessWidget {
: const Color.fromARGB(255, 48, 46, 46),
textColor: AppSettings.isDarkMode ? Colors.white : Colors.black,
key: const PageStorageKey<String>('manage-profile'),
title: const Text('Manage selected profile'),
title: Text(
'Manage selected profile',
style: GoogleFonts.firaMono(
fontWeight: FontWeight.bold,
fontSize: 15,
color: AppSettings.isDarkMode ? Colors.white : Colors.black,
),
),
children: [
for (var triple in triples)
ListTile(
Expand Down
122 changes: 83 additions & 39 deletions lib/widgets/profilefunctions/selectprofile.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';

import 'package:google_fonts/google_fonts.dart';
import 'package:sizer/sizer.dart';

import 'package:taskwarrior/config/app_settings.dart';

Expand Down Expand Up @@ -32,9 +33,17 @@ class SelectProfile extends StatelessWidget {
title: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
'Profile:',
Text(
'Current Profile:',
overflow: TextOverflow.fade,
style: GoogleFonts.firaMono(
fontWeight: FontWeight.bold,
fontSize: 15,
color: AppSettings.isDarkMode ? Colors.white : Colors.black,
),
),
SizedBox(
height: 1.h,
),
Text(currentProfile,
style: TextStyle(
Expand All @@ -43,6 +52,28 @@ class SelectProfile extends StatelessWidget {
],
),
children: [
SizedBox(
height: 1.h,
),
Padding(
padding: EdgeInsets.only(left: 4.w),
child: Row(
children: [
Text(
'All Profiles:',
overflow: TextOverflow.fade,
style: GoogleFonts.firaMono(
fontWeight: FontWeight.bold,
fontSize: 15,
color: AppSettings.isDarkMode ? Colors.white : Colors.black,
),
),
],
),
),
SizedBox(
height: 1.h,
),
for (var entry in profilesMap.entries)
SelectProfileListTile(
currentProfile,
Expand Down Expand Up @@ -71,45 +102,58 @@ class SelectProfileListTile extends StatelessWidget {

@override
Widget build(BuildContext context) {
return ListTile(
textColor: AppSettings.isDarkMode
? Colors.white
: const Color.fromARGB(255, 48, 46, 46),
iconColor: AppSettings.isDarkMode
? Colors.white
: const Color.fromARGB(255, 48, 46, 46),
leading: Radio<String>(
value: uuid,
groupValue: selectedUuid,
onChanged: (_) {
select();
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: Text('Switched to Profile ${alias ?? uuid}'),
));
},
activeColor: AppSettings.isDarkMode
? Colors.white
: const Color.fromARGB(255, 48, 46, 46),
focusColor: AppSettings.isDarkMode
? Colors.white
: const Color.fromARGB(255, 48, 46, 46),
),
title: SingleChildScrollView(
key: PageStorageKey<String>('scroll-title-$uuid'),
scrollDirection: Axis.horizontal,
child: Text(
alias ?? '',
style: GoogleFonts.firaMono(),
return Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Radio<String>(
value: uuid,
groupValue: selectedUuid,
onChanged: (_) {
select();
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: Text('Switched to Profile ${alias ?? uuid}'),
));
},
activeColor: AppSettings.isDarkMode
? Colors.white
: const Color.fromARGB(255, 48, 46, 46),
focusColor: AppSettings.isDarkMode
? Colors.white
: const Color.fromARGB(255, 48, 46, 46),
),
),
subtitle: SingleChildScrollView(
key: PageStorageKey<String>('scroll-subtitle-$uuid'),
scrollDirection: Axis.horizontal,
child: Text(
uuid,
style: GoogleFonts.firaMono(),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
if (alias != null && alias!.isNotEmpty)
SingleChildScrollView(
key: PageStorageKey<String>('scroll-title-$uuid'),
scrollDirection: Axis.horizontal,
child: Text(
alias!,
style: GoogleFonts.firaMono(
color: AppSettings.isDarkMode
? Colors.white
: const Color.fromARGB(255, 48, 46, 46),
),
),
),
SingleChildScrollView(
key: PageStorageKey<String>('scroll-subtitle-$uuid'),
scrollDirection: Axis.horizontal,
child: Text(
uuid,
style: GoogleFonts.firaMono(
color: AppSettings.isDarkMode
? Colors.white
: const Color.fromARGB(255, 48, 46, 46),
),
),
),
],
),
),
],
);
}
}
51 changes: 41 additions & 10 deletions lib/widgets/project_filter.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';

import 'package:google_fonts/google_fonts.dart';
import 'package:sizer/sizer.dart';

import 'package:taskwarrior/config/app_settings.dart';
import 'package:taskwarrior/widgets/taskw.dart';
Expand Down Expand Up @@ -46,11 +47,26 @@ class ProjectsColumn extends StatelessWidget {
projects: projects,
child: ExpansionTile(
key: const PageStorageKey('project-filter'),
title: Text(
'project:$projectFilter',
style: GoogleFonts.firaMono(
color: AppSettings.isDarkMode ? Colors.white : Colors.black,
fontSize: 18,
title: RichText(
maxLines: 2,
text: TextSpan(
children: <TextSpan>[
TextSpan(
text: 'Project : ',
style: GoogleFonts.firaMono(
fontWeight: FontWeight.bold,
fontSize: 15,
color: AppSettings.isDarkMode ? Colors.white : Colors.black,
),
),
TextSpan(
text: projectFilter,
style: GoogleFonts.firaMono(
fontSize: 15,
color: AppSettings.isDarkMode ? Colors.white : Colors.black,
),
),
],
),
),
backgroundColor: AppSettings.isDarkMode
Expand All @@ -59,11 +75,26 @@ class ProjectsColumn extends StatelessWidget {
iconColor: AppSettings.isDarkMode ? Colors.white : Colors.black,
collapsedIconColor:
AppSettings.isDarkMode ? Colors.white : Colors.black,
children: (Map.of(projects)
..removeWhere((_, nodeData) => nodeData.parent != null))
.keys
.map(ProjectTile.new)
.toList(),
children: projects.isNotEmpty
? (Map.of(projects)
..removeWhere((_, nodeData) => nodeData.parent != null))
.keys
.map(ProjectTile.new)
.toList()
: [
Text(
"No Projecs Found",
style: TextStyle(
color: (AppSettings.isDarkMode
? Colors.white
: const Color.fromARGB(255, 48, 46, 46)),
fontFamily: GoogleFonts.firaMono().fontFamily,
fontSize: 14),
),
SizedBox(
height: 2.h,
)
],
),
);
}
Expand Down

0 comments on commit 0e26d51

Please sign in to comment.