@@ -250,7 +250,7 @@ class AddTaskBottomSheet extends StatelessWidget {
250250 },
251251 fieldHintText: "Month/Date/Year" ,
252252 context: context,
253- initialDate: homeController.due.value?? DateTime .now (),
253+ initialDate: homeController.due.value ?? DateTime .now (),
254254 firstDate: DateTime .now (),
255255 lastDate: DateTime (2037 , 12 , 31 ),
256256 );
@@ -355,10 +355,7 @@ class AddTaskBottomSheet extends StatelessWidget {
355355 crossAxisAlignment: CrossAxisAlignment .center,
356356 children: [
357357 Text (
358- "${SentenceManager (
359- currentLanguage : homeController .selectedLanguage .value )
360- .sentences
361- .addTaskPriority } :" ,
358+ "${SentenceManager (currentLanguage : homeController .selectedLanguage .value ).sentences .addTaskPriority } :" ,
362359 style: GoogleFonts .poppins (
363360 fontWeight: TaskWarriorFonts .bold,
364361 color: AppSettings .isDarkMode
@@ -367,51 +364,54 @@ class AddTaskBottomSheet extends StatelessWidget {
367364 ),
368365 textAlign: TextAlign .left,
369366 ),
370- const SizedBox (width: 2 ,),
367+ const SizedBox (
368+ width: 2 ,
369+ ),
371370 Obx (
372371 () => Row (
373372 children: [
374- for (int i= 0 ;i < homeController.priorityList.length;i++ )
373+ for (int i = 0 ; i < homeController.priorityList.length; i++ )
375374 Padding (
376375 padding: const EdgeInsets .symmetric (horizontal: 2.5 ),
377376 child: GestureDetector (
378377 onTap: () {
379- homeController.priority.value = homeController.priorityList[i];
378+ homeController.priority.value =
379+ homeController.priorityList[i];
380380 debugPrint (homeController.priority.value);
381381 },
382382 child: AnimatedContainer (
383383 duration: const Duration (milliseconds: 100 ),
384384 height: 30 ,
385385 width: 37 ,
386386 decoration: BoxDecoration (
387-
388- borderRadius: BorderRadius .circular (8 ),
389- border: Border .all (
390- color: homeController.priority.value == homeController.priorityList[i]
391- ? AppSettings .isDarkMode
392- ? TaskWarriorColors .kLightPrimaryBackgroundColor
393- : TaskWarriorColors .kprimaryBackgroundColor
394- : AppSettings .isDarkMode
395- ? TaskWarriorColors .kprimaryBackgroundColor
396- : TaskWarriorColors .kLightPrimaryBackgroundColor,
397- )
398- ),
387+ borderRadius: BorderRadius .circular (8 ),
388+ border: Border .all (
389+ color: homeController.priority.value ==
390+ homeController.priorityList[i]
391+ ? AppSettings .isDarkMode
392+ ? TaskWarriorColors
393+ .kLightPrimaryBackgroundColor
394+ : TaskWarriorColors
395+ .kprimaryBackgroundColor
396+ : AppSettings .isDarkMode
397+ ? TaskWarriorColors
398+ .kprimaryBackgroundColor
399+ : TaskWarriorColors
400+ .kLightPrimaryBackgroundColor,
401+ )),
399402 child: Center (
400403 child: Text (
401404 homeController.priorityList[i],
402405 textAlign: TextAlign .center,
403406 style: GoogleFonts .poppins (
404- fontWeight: FontWeight .bold,
405- fontSize: 17 ,
406- color: homeController.priorityColors[i]
407- ),
407+ fontWeight: FontWeight .bold,
408+ fontSize: 17 ,
409+ color: homeController.priorityColors[i]),
408410 ),
409411 ),
410412 ),
411-
412413 ),
413414 )
414-
415415 ],
416416 ),
417417 )
@@ -448,8 +448,7 @@ class AddTaskBottomSheet extends StatelessWidget {
448448 Widget buildAddButton (BuildContext context) {
449449 return TextButton (
450450 child: Text (
451- SentenceManager (
452- currentLanguage: homeController.selectedLanguage.value)
451+ SentenceManager (currentLanguage: homeController.selectedLanguage.value)
453452 .sentences
454453 .addTaskAdd,
455454 style: TextStyle (
@@ -460,12 +459,12 @@ class AddTaskBottomSheet extends StatelessWidget {
460459 ),
461460 onPressed: () async {
462461 // print(homeController.formKey.currentState);
463- if (homeController.due.value!= null && DateTime .now ().isAfter (homeController.due.value! )){
462+ if (homeController.due.value != null &&
463+ DateTime .now ().isAfter (homeController.due.value! )) {
464464 ScaffoldMessenger .of (context).showSnackBar (SnackBar (
465465 content: Text (
466466 SentenceManager (
467- currentLanguage:
468- homeController.selectedLanguage.value)
467+ currentLanguage: homeController.selectedLanguage.value)
469468 .sentences
470469 .addTaskTimeInPast,
471470 style: TextStyle (
@@ -476,8 +475,7 @@ class AddTaskBottomSheet extends StatelessWidget {
476475 ),
477476 backgroundColor: AppSettings .isDarkMode
478477 ? TaskWarriorColors .ksecondaryBackgroundColor
479- : TaskWarriorColors
480- .kLightSecondaryBackgroundColor,
478+ : TaskWarriorColors .kLightSecondaryBackgroundColor,
481479 duration: const Duration (seconds: 2 )));
482480 return ;
483481 }
@@ -501,13 +499,12 @@ class AddTaskBottomSheet extends StatelessWidget {
501499 homeController.priority.value = 'M' ;
502500 homeController.tagcontroller.text = '' ;
503501 homeController.tags.value = [];
504- homeController.due.value= null ;
502+ homeController.due.value = null ;
505503 homeController.update ();
506504 // Navigator.of(context).pop();
507505 Get .back ();
508506 if (Platform .isAndroid) {
509- WidgetController widgetController =
510- Get .put (WidgetController ());
507+ WidgetController widgetController = Get .put (WidgetController ());
511508 widgetController.fetchAllData ();
512509
513510 widgetController.update ();
@@ -518,7 +515,8 @@ class AddTaskBottomSheet extends StatelessWidget {
518515 ScaffoldMessenger .of (context).showSnackBar (SnackBar (
519516 content: Text (
520517 SentenceManager (
521- currentLanguage: homeController.selectedLanguage.value)
518+ currentLanguage:
519+ homeController.selectedLanguage.value)
522520 .sentences
523521 .addTaskTaskAddedSuccessfully,
524522 style: TextStyle (
@@ -542,6 +540,7 @@ class AddTaskBottomSheet extends StatelessWidget {
542540 if (value) {
543541 storageWidget.synchronize (context, true );
544542 }
543+ homeController.showTaskSwipeTutorial (context);
545544 } on FormatException catch (e) {
546545 ScaffoldMessenger .of (context).showSnackBar (SnackBar (
547546 content: Text (
@@ -567,18 +566,20 @@ class AddTaskBottomSheet extends StatelessWidget {
567566 if (tag.isNotEmpty) {
568567 String trimmedString = tag.trim ();
569568 List <String > tags = trimmedString.split (" " );
570- for (tag in tags){
571- if (checkTagIfExists (tag)) {
569+ for (tag in tags) {
570+ if (checkTagIfExists (tag)) {
572571 removeTag (tag);
573572 }
574573 homeController.tags.add (tag);
575574 }
576575 homeController.tagcontroller.text = '' ;
577576 }
578577 }
579- bool checkTagIfExists (String tag){
578+
579+ bool checkTagIfExists (String tag) {
580580 return homeController.tags.contains (tag);
581581 }
582+
582583 void removeTag (String tag) {
583584 homeController.tags.remove (tag);
584585 }
0 commit comments