Skip to content

Commit

Permalink
Merge pull request #431 from arjav1528/Fixed-Issue-#419
Browse files Browse the repository at this point in the history
Fixed issue #419
  • Loading branch information
Pavel401 authored Jan 11, 2025
2 parents 7cbfe01 + ef7049a commit fc9b8af
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ class DetailRouteController extends GetxController {
void setAttribute(String name, dynamic newValue) {
modify.set(name, newValue);
onEdit.value = true;
if(name == 'start'){
debugPrint('Start Value Changed to $newValue');
startValue.value = newValue;
}
initValues();
}

Expand Down Expand Up @@ -82,7 +86,7 @@ class DetailRouteController extends GetxController {
statusValue.value = modify.draft.status;
entryValue.value = modify.draft.entry;
modifiedValue.value = modify.draft.modified;
startValue.value = modify.draft.start;
startValue.value ??= null;
endValue.value = modify.draft.end;
dueValue.value = modify.draft.due;
waitValue.value = modify.draft.wait;
Expand Down
13 changes: 12 additions & 1 deletion lib/app/modules/home/controllers/home_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,18 @@ class HomeController extends GetxController {
final projectcontroller = TextEditingController();
var due = Rxn<DateTime>();
RxString dueString = ''.obs;
RxString priority = 'M'.obs;
final priorityList = ['L','X','M','H'];
final priorityColors = [
TaskWarriorColors.green,
TaskWarriorColors.grey,
TaskWarriorColors.yellow,
TaskWarriorColors.red,



];
RxString priority = 'X'.obs;

final tagcontroller = TextEditingController();
RxList<String> tags = <String>[].obs;
RxBool inThePast = false.obs;
Expand Down
72 changes: 45 additions & 27 deletions lib/app/modules/home/views/add_task_bottom_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -367,34 +367,52 @@ class AddTaskBottomSheet extends StatelessWidget {
),
textAlign: TextAlign.left,
),
const SizedBox(width: 2,),
Obx(
() => DropdownButton<String>(
dropdownColor: AppSettings.isDarkMode
? TaskWarriorColors.kdialogBackGroundColor
: TaskWarriorColors.kLightDialogBackGroundColor,
value: homeController.priority.value,
elevation: 16,
style: GoogleFonts.poppins(
color: AppSettings.isDarkMode
? TaskWarriorColors.white
: TaskWarriorColors.black,
),
underline: Container(
height: 1.5,
color: AppSettings.isDarkMode
? TaskWarriorColors.kdialogBackGroundColor
: TaskWarriorColors.kLightDialogBackGroundColor,
),
onChanged: (String? newValue) {
homeController.priority.value = newValue!;
},
items: <String>['H', 'M', 'L', 'None']
.map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(' $value'),
);
}).toList(),
() => Row(
children: [
for(int i=0;i<homeController.priorityList.length;i++)
Padding(
padding: const EdgeInsets.symmetric(horizontal: 2.5),
child: GestureDetector(
onTap: () {
homeController.priority.value = homeController.priorityList[i];
debugPrint(homeController.priority.value);
},
child: AnimatedContainer(
duration: const Duration(milliseconds: 100),
height: 30,
width: 37,
decoration: BoxDecoration(

borderRadius: BorderRadius.circular(8),
border: Border.all(
color: homeController.priority.value == homeController.priorityList[i]
? AppSettings.isDarkMode
? TaskWarriorColors.kLightPrimaryBackgroundColor
: TaskWarriorColors.kprimaryBackgroundColor
: AppSettings.isDarkMode
? TaskWarriorColors.kprimaryBackgroundColor
: TaskWarriorColors.kLightPrimaryBackgroundColor,
)
),
child: Center(
child: Text(
homeController.priorityList[i],
textAlign: TextAlign.center,
style: GoogleFonts.poppins(
fontWeight: FontWeight.bold,
fontSize: 17,
color: homeController.priorityColors[i]
),
),
),
),

),
)

],
),
)
],
Expand Down
2 changes: 1 addition & 1 deletion pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ packages:
source: hosted
version: "7.2.11"
built_collection:
dependency: transitive
dependency: "direct main"
description:
name: built_collection
sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100"
Expand Down

0 comments on commit fc9b8af

Please sign in to comment.