Skip to content

Commit 539135b

Browse files
committed
Fixed The Issue
1 parent 77848da commit 539135b

File tree

2 files changed

+53
-27
lines changed

2 files changed

+53
-27
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,15 @@ class HomeController extends GetxController {
508508
final projectcontroller = TextEditingController();
509509
var due = Rxn<DateTime>();
510510
RxString dueString = ''.obs;
511+
final priorityList = ['H', 'M', 'L','X'];
512+
final priorityColors = [
513+
TaskWarriorColors.red,
514+
TaskWarriorColors.yellow,
515+
TaskWarriorColors.green,
516+
TaskWarriorColors.grey
517+
];
511518
RxString priority = 'M'.obs;
519+
512520
final tagcontroller = TextEditingController();
513521
RxList<String> tags = <String>[].obs;
514522
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
],

0 commit comments

Comments
 (0)