@@ -96,7 +96,7 @@ class AddTaskBottomSheet extends StatelessWidget {
9696 padding: const EdgeInsets .all (padding),
9797 child: TextFormField (
9898 controller: homeController.namecontroller,
99- validator: (value) => value! .isEmpty
99+ validator: (value) => value! .trim (). isEmpty
100100 ? SentenceManager (
101101 currentLanguage:
102102 homeController.selectedLanguage.value)
@@ -317,7 +317,7 @@ class AddTaskBottomSheet extends StatelessWidget {
317317 if (homeController.formKey.currentState! .validate ()) {
318318 debugPrint ("tags ${homeController .tags }" );
319319 var task = TaskForC (
320- description: homeController.namecontroller.text,
320+ description: homeController.namecontroller.text. trim () ,
321321 status: 'pending' ,
322322 priority: homeController.priority.value,
323323 entry: DateTime .now ().toIso8601String (),
@@ -365,7 +365,7 @@ class AddTaskBottomSheet extends StatelessWidget {
365365 void onSaveButtonClicked (BuildContext context) async {
366366 if (homeController.formKey.currentState! .validate ()) {
367367 try {
368- var task = taskParser (homeController.namecontroller.text)
368+ var task = taskParser (homeController.namecontroller.text. trim () )
369369 .rebuild ((b) =>
370370 b..due = getDueDate (homeController.selectedDates)? .toUtc ())
371371 .rebuild ((p) => p..priority = homeController.priority.value)
@@ -451,7 +451,7 @@ class AddTaskBottomSheet extends StatelessWidget {
451451 if (homeController.formKey.currentState! .validate ()) {
452452 try {
453453 await Replica .addTaskToReplica (HashMap <String , dynamic >.from ({
454- "description" : homeController.namecontroller.text,
454+ "description" : homeController.namecontroller.text. trim () ,
455455 "due" : getDueDate (homeController.selectedDates)? .toUtc (),
456456 "priority" : homeController.priority.value,
457457 "project" : homeController.projectcontroller.text != ""
0 commit comments