Skip to content

Commit fc9b8af

Browse files
authored
Merge pull request #431 from arjav1528/Fixed-Issue-#419
Fixed issue #419
2 parents 7cbfe01 + ef7049a commit fc9b8af

File tree

4 files changed

+63
-30
lines changed

4 files changed

+63
-30
lines changed

lib/app/modules/detailRoute/controllers/detail_route_controller.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ class DetailRouteController extends GetxController {
3434
void setAttribute(String name, dynamic newValue) {
3535
modify.set(name, newValue);
3636
onEdit.value = true;
37+
if(name == 'start'){
38+
debugPrint('Start Value Changed to $newValue');
39+
startValue.value = newValue;
40+
}
3741
initValues();
3842
}
3943

@@ -82,7 +86,7 @@ class DetailRouteController extends GetxController {
8286
statusValue.value = modify.draft.status;
8387
entryValue.value = modify.draft.entry;
8488
modifiedValue.value = modify.draft.modified;
85-
startValue.value = modify.draft.start;
89+
startValue.value ??= null;
8690
endValue.value = modify.draft.end;
8791
dueValue.value = modify.draft.due;
8892
waitValue.value = modify.draft.wait;

lib/app/modules/home/controllers/home_controller.dart

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,18 @@ class HomeController extends GetxController {
508508
final projectcontroller = TextEditingController();
509509
var due = Rxn<DateTime>();
510510
RxString dueString = ''.obs;
511-
RxString priority = 'M'.obs;
511+
final priorityList = ['L','X','M','H'];
512+
final priorityColors = [
513+
TaskWarriorColors.green,
514+
TaskWarriorColors.grey,
515+
TaskWarriorColors.yellow,
516+
TaskWarriorColors.red,
517+
518+
519+
520+
];
521+
RxString priority = 'X'.obs;
522+
512523
final tagcontroller = TextEditingController();
513524
RxList<String> tags = <String>[].obs;
514525
RxBool inThePast = false.obs;

lib/app/modules/home/views/add_task_bottom_sheet.dart

Lines changed: 45 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -367,34 +367,52 @@ class AddTaskBottomSheet extends StatelessWidget {
367367
),
368368
textAlign: TextAlign.left,
369369
),
370+
const SizedBox(width: 2,),
370371
Obx(
371-
() => DropdownButton<String>(
372-
dropdownColor: AppSettings.isDarkMode
373-
? TaskWarriorColors.kdialogBackGroundColor
374-
: TaskWarriorColors.kLightDialogBackGroundColor,
375-
value: homeController.priority.value,
376-
elevation: 16,
377-
style: GoogleFonts.poppins(
378-
color: AppSettings.isDarkMode
379-
? TaskWarriorColors.white
380-
: TaskWarriorColors.black,
381-
),
382-
underline: Container(
383-
height: 1.5,
384-
color: AppSettings.isDarkMode
385-
? TaskWarriorColors.kdialogBackGroundColor
386-
: TaskWarriorColors.kLightDialogBackGroundColor,
387-
),
388-
onChanged: (String? newValue) {
389-
homeController.priority.value = newValue!;
390-
},
391-
items: <String>['H', 'M', 'L', 'None']
392-
.map<DropdownMenuItem<String>>((String value) {
393-
return DropdownMenuItem<String>(
394-
value: value,
395-
child: Text(' $value'),
396-
);
397-
}).toList(),
372+
() => Row(
373+
children: [
374+
for(int i=0;i<homeController.priorityList.length;i++)
375+
Padding(
376+
padding: const EdgeInsets.symmetric(horizontal: 2.5),
377+
child: GestureDetector(
378+
onTap: () {
379+
homeController.priority.value = homeController.priorityList[i];
380+
debugPrint(homeController.priority.value);
381+
},
382+
child: AnimatedContainer(
383+
duration: const Duration(milliseconds: 100),
384+
height: 30,
385+
width: 37,
386+
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+
),
399+
child: Center(
400+
child: Text(
401+
homeController.priorityList[i],
402+
textAlign: TextAlign.center,
403+
style: GoogleFonts.poppins(
404+
fontWeight: FontWeight.bold,
405+
fontSize: 17,
406+
color: homeController.priorityColors[i]
407+
),
408+
),
409+
),
410+
),
411+
412+
),
413+
)
414+
415+
],
398416
),
399417
)
400418
],

pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ packages:
106106
source: hosted
107107
version: "7.2.11"
108108
built_collection:
109-
dependency: transitive
109+
dependency: "direct main"
110110
description:
111111
name: built_collection
112112
sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100"

0 commit comments

Comments
 (0)