Skip to content

Commit d380522

Browse files
authored
Merge pull request #315 from Sabra-xD/dev
Dev
2 parents 0364e2a + dd5a984 commit d380522

File tree

4 files changed

+158
-81
lines changed

4 files changed

+158
-81
lines changed

lib/taskserver/ntaskserver.dart

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,24 @@ class _ManageTaskServerState extends State<ManageTaskServer> {
159159
// Dismiss the loading dialog
160160
Navigator.of(context).pop();
161161

162+
//Displaying Error message.
163+
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
164+
content: Text(
165+
trace.toString().startsWith("#0")
166+
? "Please set up your TaskServer."
167+
: e.toString(),
168+
style: TextStyle(
169+
color: AppSettings.isDarkMode
170+
? TaskWarriorColors.kprimaryTextColor
171+
: TaskWarriorColors.kLightPrimaryTextColor,
172+
),
173+
),
174+
backgroundColor: AppSettings.isDarkMode
175+
? TaskWarriorColors.ksecondaryBackgroundColor
176+
: TaskWarriorColors.kLightSecondaryBackgroundColor,
177+
duration: const Duration(seconds: 2)));
162178
// Log the error and trace
163179
logError(e, trace);
164-
165180
// Refresh the state of ProfilesWidget
166181
ProfilesWidget.of(context).setState(() {});
167182
}

lib/views/about/about.dart

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -111,29 +111,37 @@ class _AboutPageState extends State<AboutPage> {
111111
],
112112
),
113113
),
114-
RichText(
115-
text: TextSpan(
116-
children: <TextSpan>[
117-
TextSpan(
118-
text: 'Package: ',
119-
style: GoogleFonts.poppins(
120-
fontWeight: TaskWarriorFonts.bold,
121-
fontSize: TaskWarriorFonts.fontSizeMedium,
122-
color: AppSettings.isDarkMode
123-
? TaskWarriorColors.white
124-
: TaskWarriorColors.black,
125-
),
126-
),
127-
TextSpan(
128-
text: appInfoLines[0],
129-
style: GoogleFonts.poppins(
130-
fontSize: TaskWarriorFonts.fontSizeMedium,
131-
color: AppSettings.isDarkMode
132-
? TaskWarriorColors.white
133-
: TaskWarriorColors.black,
134-
),
114+
SizedBox(
115+
width: 85.w,
116+
child: FittedBox(
117+
fit: BoxFit.fitWidth,
118+
child: RichText(
119+
text: TextSpan(
120+
children: <TextSpan>[
121+
TextSpan(
122+
text: 'Package: ',
123+
style: GoogleFonts.poppins(
124+
fontWeight: TaskWarriorFonts.bold,
125+
fontSize:
126+
TaskWarriorFonts.fontSizeMedium,
127+
color: AppSettings.isDarkMode
128+
? TaskWarriorColors.white
129+
: TaskWarriorColors.black,
130+
),
131+
),
132+
TextSpan(
133+
text: appInfoLines[0],
134+
style: GoogleFonts.poppins(
135+
fontSize:
136+
TaskWarriorFonts.fontSizeMedium,
137+
color: AppSettings.isDarkMode
138+
? TaskWarriorColors.white
139+
: TaskWarriorColors.black,
140+
),
141+
),
142+
],
135143
),
136-
],
144+
),
137145
),
138146
),
139147
],

lib/widgets/add_Task.dart

Lines changed: 72 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// ignore_for_file: library_private_types_in_public_api, use_build_context_synchronously, file_names
22

33
import 'dart:developer';
4-
54
import 'package:flutter/material.dart';
65
import 'package:get/get.dart';
76
import 'package:google_fonts/google_fonts.dart';
@@ -12,7 +11,6 @@ import 'package:taskwarrior/config/taskwarriorcolors.dart';
1211
import 'package:taskwarrior/config/taskwarriorfonts.dart';
1312
import 'package:taskwarrior/controller/WidgetController.dart';
1413
import 'package:taskwarrior/model/storage/storage_widget.dart';
15-
import 'package:taskwarrior/utility/utilities.dart';
1614
import 'package:taskwarrior/widgets/taskfunctions/taskparser.dart';
1715
import 'package:taskwarrior/widgets/taskw.dart';
1816

@@ -31,6 +29,7 @@ class _AddTaskBottomSheetState extends State<AddTaskBottomSheet> {
3129
String priority = 'M';
3230
final tagcontroller = TextEditingController();
3331
List<String> tags = [];
32+
bool inThePast = false;
3433

3534
@override
3635
void initState() {
@@ -47,42 +46,53 @@ class _AddTaskBottomSheetState extends State<AddTaskBottomSheet> {
4746
@override
4847
Widget build(BuildContext context) {
4948
const title = 'Add Task';
50-
51-
return Center(
52-
child: SingleChildScrollView(
53-
child: Utils.showAlertDialog(
54-
title: Center(
55-
child: Text(
56-
title,
57-
style: TextStyle(
58-
color: AppSettings.isDarkMode
59-
? TaskWarriorColors.white
60-
: TaskWarriorColors.black,
49+
return Scaffold(
50+
backgroundColor: Colors.transparent,
51+
body: Center(
52+
child: SingleChildScrollView(
53+
child: AlertDialog(
54+
surfaceTintColor: AppSettings.isDarkMode
55+
? TaskWarriorColors.kdialogBackGroundColor
56+
: TaskWarriorColors.kLightDialogBackGroundColor,
57+
shadowColor: AppSettings.isDarkMode
58+
? TaskWarriorColors.kdialogBackGroundColor
59+
: TaskWarriorColors.kLightDialogBackGroundColor,
60+
backgroundColor: AppSettings.isDarkMode
61+
? TaskWarriorColors.kdialogBackGroundColor
62+
: TaskWarriorColors.kLightDialogBackGroundColor,
63+
title: Center(
64+
child: Text(
65+
title,
66+
style: TextStyle(
67+
color: AppSettings.isDarkMode
68+
? TaskWarriorColors.white
69+
: TaskWarriorColors.black,
70+
),
6171
),
6272
),
63-
),
64-
content: Form(
65-
key: formKey,
66-
child: SizedBox(
67-
width: MediaQuery.of(context).size.width * 0.8,
68-
child: Column(
69-
mainAxisSize: MainAxisSize.min,
70-
children: <Widget>[
71-
const SizedBox(height: 8),
72-
buildName(),
73-
const SizedBox(height: 12),
74-
buildDueDate(context),
75-
const SizedBox(height: 8),
76-
buildPriority(),
77-
buildTags(),
78-
],
73+
content: Form(
74+
key: formKey,
75+
child: SizedBox(
76+
width: MediaQuery.of(context).size.width * 0.8,
77+
child: Column(
78+
mainAxisSize: MainAxisSize.min,
79+
children: <Widget>[
80+
const SizedBox(height: 8),
81+
buildName(),
82+
const SizedBox(height: 12),
83+
buildDueDate(context),
84+
const SizedBox(height: 8),
85+
buildPriority(),
86+
buildTags(),
87+
],
88+
),
7989
),
8090
),
91+
actions: <Widget>[
92+
buildCancelButton(context),
93+
buildAddButton(context),
94+
],
8195
),
82-
actions: <Widget>[
83-
buildCancelButton(context),
84-
buildAddButton(context),
85-
],
8696
),
8797
),
8898
);
@@ -180,22 +190,26 @@ class _AddTaskBottomSheetState extends State<AddTaskBottomSheet> {
180190
Expanded(
181191
child: GestureDetector(
182192
child: TextFormField(
183-
style: TextStyle(
184-
color: AppSettings.isDarkMode
185-
? TaskWarriorColors.white
186-
: TaskWarriorColors.black,
187-
),
193+
style: inThePast
194+
? TextStyle(color: TaskWarriorColors.red)
195+
: TextStyle(
196+
color: AppSettings.isDarkMode
197+
? TaskWarriorColors.white
198+
: TaskWarriorColors.black,
199+
),
188200
readOnly: true,
189201
controller: TextEditingController(
190202
text: (due != null) ? dueString : null,
191203
),
192204
decoration: InputDecoration(
193205
hintText: 'Select due date',
194-
hintStyle: TextStyle(
195-
color: AppSettings.isDarkMode
196-
? TaskWarriorColors.white
197-
: TaskWarriorColors.black,
198-
),
206+
hintStyle: inThePast
207+
? TextStyle(color: TaskWarriorColors.red)
208+
: TextStyle(
209+
color: AppSettings.isDarkMode
210+
? TaskWarriorColors.white
211+
: TaskWarriorColors.black,
212+
),
199213
),
200214
onTap: () async {
201215
var date = await showDatePicker(
@@ -287,16 +301,18 @@ class _AddTaskBottomSheetState extends State<AddTaskBottomSheet> {
287301
minutes: time.minute,
288302
),
289303
);
290-
if (dateTime.isAfter(DateTime.now())) {
291-
due = dateTime.toUtc();
304+
due = dateTime.toUtc();
305+
dueString =
306+
DateFormat("dd-MM-yyyy HH:mm").format(dateTime);
307+
if (dateTime.isBefore(DateTime.now())) {
308+
//Try changing the color. in the settings and Due display.
309+
setState(() {
310+
inThePast = true;
311+
});
292312

293-
dueString =
294-
DateFormat("dd-MM-yyyy HH:mm").format(dateTime);
295-
setState(() {});
296-
} else {
297313
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
298314
content: Text(
299-
'Please select a due date and time in the future.',
315+
"The selected time is in the past.",
300316
style: TextStyle(
301317
color: AppSettings.isDarkMode
302318
? TaskWarriorColors.kprimaryTextColor
@@ -308,7 +324,13 @@ class _AddTaskBottomSheetState extends State<AddTaskBottomSheet> {
308324
: TaskWarriorColors
309325
.kLightSecondaryBackgroundColor,
310326
duration: const Duration(seconds: 2)));
327+
} else {
328+
setState(() {
329+
inThePast = false;
330+
});
311331
}
332+
333+
// setState(() {});
312334
}
313335
}
314336
},

pubspec.lock

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,30 @@ packages:
624624
url: "https://pub.dev"
625625
source: hosted
626626
version: "4.8.1"
627+
leak_tracker:
628+
dependency: transitive
629+
description:
630+
name: leak_tracker
631+
sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa"
632+
url: "https://pub.dev"
633+
source: hosted
634+
version: "10.0.0"
635+
leak_tracker_flutter_testing:
636+
dependency: transitive
637+
description:
638+
name: leak_tracker_flutter_testing
639+
sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0
640+
url: "https://pub.dev"
641+
source: hosted
642+
version: "2.0.1"
643+
leak_tracker_testing:
644+
dependency: transitive
645+
description:
646+
name: leak_tracker_testing
647+
sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47
648+
url: "https://pub.dev"
649+
source: hosted
650+
version: "2.0.1"
627651
lints:
628652
dependency: transitive
629653
description:
@@ -652,26 +676,26 @@ packages:
652676
dependency: transitive
653677
description:
654678
name: matcher
655-
sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e"
679+
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
656680
url: "https://pub.dev"
657681
source: hosted
658-
version: "0.12.16"
682+
version: "0.12.16+1"
659683
material_color_utilities:
660684
dependency: transitive
661685
description:
662686
name: material_color_utilities
663-
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
687+
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
664688
url: "https://pub.dev"
665689
source: hosted
666-
version: "0.5.0"
690+
version: "0.8.0"
667691
meta:
668692
dependency: transitive
669693
description:
670694
name: meta
671-
sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e
695+
sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04
672696
url: "https://pub.dev"
673697
source: hosted
674-
version: "1.10.0"
698+
version: "1.11.0"
675699
mime:
676700
dependency: transitive
677701
description:
@@ -716,10 +740,10 @@ packages:
716740
dependency: transitive
717741
description:
718742
name: path
719-
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
743+
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
720744
url: "https://pub.dev"
721745
source: hosted
722-
version: "1.8.3"
746+
version: "1.9.0"
723747
path_parsing:
724748
dependency: transitive
725749
description:
@@ -1242,6 +1266,14 @@ packages:
12421266
url: "https://pub.dev"
12431267
source: hosted
12441268
version: "2.1.4"
1269+
vm_service:
1270+
dependency: transitive
1271+
description:
1272+
name: vm_service
1273+
sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957
1274+
url: "https://pub.dev"
1275+
source: hosted
1276+
version: "13.0.0"
12451277
watcher:
12461278
dependency: transitive
12471279
description:

0 commit comments

Comments
 (0)