Skip to content

Commit 832fe7d

Browse files
Merge pull request #25 from bhav-khurana/task-list-tile
Bug fix and Minor UI changes
2 parents 920f279 + 40c2b1c commit 832fe7d

File tree

2 files changed

+35
-25
lines changed

2 files changed

+35
-25
lines changed

lib/widgets/taskdetails/tags_widget.dart

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import 'package:taskwarrior/model/storage/storage_widget.dart';
88

99
import 'package:taskwarrior/widgets/taskw.dart';
1010

11+
import '../pallete.dart';
12+
1113
class TagsWidget extends StatelessWidget {
1214
const TagsWidget({
1315
required this.name,
@@ -73,8 +75,12 @@ class TagsRouteState extends State<TagsRoute> {
7375
}
7476

7577
void _removeTag(String tag) {
76-
draftTags!.remove(tag);
77-
widget.callback((draftTags!.isEmpty) ? null : draftTags);
78+
if (draftTags!.length == 1) {
79+
draftTags!.remove(tag);
80+
draftTags = null;
81+
}
82+
else draftTags!.remove(tag);
83+
widget.callback(draftTags ?? ListBuilder([]));
7884
setState(() {});
7985
}
8086

@@ -99,7 +105,11 @@ class TagsRouteState extends State<TagsRoute> {
99105
Widget build(BuildContext context) {
100106
return Scaffold(
101107
appBar: AppBar(
102-
title: const Text('tags'),
108+
backgroundColor: Palette.kToDark.shade200,
109+
title: const Text('Tags', style: TextStyle(color: Colors.white),),
110+
leading: const BackButton(
111+
color: Colors.white,
112+
),
103113
),
104114
body: SafeArea(
105115
child: Padding(
@@ -112,16 +122,23 @@ class TagsRouteState extends State<TagsRoute> {
112122
if (draftTags != null)
113123
for (var tag in draftTags!.build())
114124
FilterChip(
125+
backgroundColor: Colors.grey.shade200,
115126
onSelected: (_) => _removeTag(tag),
116127
label: Text(
117128
'+$tag ${_pendingTags?[tag]?.frequency ?? 0}',
118129
),
119130
),
120-
const Divider(),
131+
if (draftTags == null)
132+
const Padding(
133+
padding: EdgeInsets.fromLTRB(15, 18, 0, 10),
134+
child: Text('Added tags will appear here', style: TextStyle(fontStyle: FontStyle.italic),),
135+
),
136+
Divider(color: Palette.kToDark.shade200,),
121137
if (_pendingTags != null)
122138
for (var tag in _pendingTags!.entries.where((tag) =>
123139
!(draftTags?.build().contains(tag.key) ?? false)))
124140
FilterChip(
141+
backgroundColor: Colors.grey.shade200,
125142
onSelected: (_) => _addTag(tag.key),
126143
label: Text(
127144
'${tag.key} ${tag.value.frequency}',

pubspec.lock

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ packages:
3535
name: async
3636
url: "https://pub.dartlang.org"
3737
source: hosted
38-
version: "2.8.2"
38+
version: "2.9.0"
3939
boolean_selector:
4040
dependency: transitive
4141
description:
@@ -105,14 +105,7 @@ packages:
105105
name: characters
106106
url: "https://pub.dartlang.org"
107107
source: hosted
108-
version: "1.2.0"
109-
charcode:
110-
dependency: transitive
111-
description:
112-
name: charcode
113-
url: "https://pub.dartlang.org"
114-
source: hosted
115-
version: "1.3.1"
108+
version: "1.2.1"
116109
checked_yaml:
117110
dependency: transitive
118111
description:
@@ -126,7 +119,7 @@ packages:
126119
name: clock
127120
url: "https://pub.dartlang.org"
128121
source: hosted
129-
version: "1.1.0"
122+
version: "1.1.1"
130123
code_builder:
131124
dependency: transitive
132125
description:
@@ -196,7 +189,7 @@ packages:
196189
name: fake_async
197190
url: "https://pub.dartlang.org"
198191
source: hosted
199-
version: "1.3.0"
192+
version: "1.3.1"
200193
ffi:
201194
dependency: transitive
202195
description:
@@ -456,21 +449,21 @@ packages:
456449
name: matcher
457450
url: "https://pub.dartlang.org"
458451
source: hosted
459-
version: "0.12.11"
452+
version: "0.12.12"
460453
material_color_utilities:
461454
dependency: transitive
462455
description:
463456
name: material_color_utilities
464457
url: "https://pub.dartlang.org"
465458
source: hosted
466-
version: "0.1.4"
459+
version: "0.2.0"
467460
meta:
468461
dependency: transitive
469462
description:
470463
name: meta
471464
url: "https://pub.dartlang.org"
472465
source: hosted
473-
version: "1.7.0"
466+
version: "1.8.0"
474467
mime:
475468
dependency: transitive
476469
description:
@@ -533,7 +526,7 @@ packages:
533526
name: path
534527
url: "https://pub.dartlang.org"
535528
source: hosted
536-
version: "1.8.1"
529+
version: "1.8.2"
537530
path_provider:
538531
dependency: transitive
539532
description:
@@ -741,7 +734,7 @@ packages:
741734
name: source_span
742735
url: "https://pub.dartlang.org"
743736
source: hosted
744-
version: "1.8.2"
737+
version: "1.9.1"
745738
stack_trace:
746739
dependency: transitive
747740
description:
@@ -769,7 +762,7 @@ packages:
769762
name: string_scanner
770763
url: "https://pub.dartlang.org"
771764
source: hosted
772-
version: "1.1.0"
765+
version: "1.1.1"
773766
synchronized:
774767
dependency: transitive
775768
description:
@@ -783,14 +776,14 @@ packages:
783776
name: term_glyph
784777
url: "https://pub.dartlang.org"
785778
source: hosted
786-
version: "1.2.0"
779+
version: "1.2.1"
787780
test_api:
788781
dependency: transitive
789782
description:
790783
name: test_api
791784
url: "https://pub.dartlang.org"
792785
source: hosted
793-
version: "0.4.9"
786+
version: "0.4.13"
794787
timing:
795788
dependency: transitive
796789
description:
@@ -832,7 +825,7 @@ packages:
832825
name: vector_math
833826
url: "https://pub.dartlang.org"
834827
source: hosted
835-
version: "2.1.2"
828+
version: "2.1.3"
836829
watcher:
837830
dependency: transitive
838831
description:
@@ -876,5 +869,5 @@ packages:
876869
source: hosted
877870
version: "3.1.1"
878871
sdks:
879-
dart: ">=2.17.0 <3.0.0"
872+
dart: ">=2.18.0-146.0.dev <3.0.0"
880873
flutter: ">=3.0.0"

0 commit comments

Comments
 (0)