Feature_Report_Action #48

Merged
vaibhav.surve merged 19 commits from Feature_Report_Action into main 2025-06-23 07:32:30 +00:00
Showing only changes of commit ca8bc26ab5 - Show all commits

View File

@ -35,13 +35,15 @@ void showCreateTaskBottomSheet({
return // Inside showManageTaskBottomSheet... return // Inside showManageTaskBottomSheet...
SafeArea( SafeArea(
child: Material( child: Material(
color: Colors.white, color: Colors.white,
borderRadius: const BorderRadius.vertical(top: Radius.circular(20)), borderRadius:
const BorderRadius.vertical(top: Radius.circular(20)),
child: Container( child: Container(
constraints: const BoxConstraints(maxHeight: 760), constraints: const BoxConstraints(maxHeight: 760),
padding: EdgeInsets.fromLTRB(horizontalPadding, 12, horizontalPadding, 24), padding: EdgeInsets.fromLTRB(
horizontalPadding, 12, horizontalPadding, 24),
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -65,9 +67,12 @@ SafeArea(
), ),
const SizedBox(height: 20), const SizedBox(height: 20),
_infoCardSection([ _infoCardSection([
_infoRowWithIcon(Icons.workspaces, "Selected Work Area", workArea), _infoRowWithIcon(
_infoRowWithIcon(Icons.list_alt, "Selected Activity", activity), Icons.workspaces, "Selected Work Area", workArea),
_infoRowWithIcon(Icons.check_circle_outline, "Completed Work", completedWork), _infoRowWithIcon(
Icons.list_alt, "Selected Activity", activity),
_infoRowWithIcon(Icons.check_circle_outline,
"Completed Work", completedWork),
]), ]),
const SizedBox(height: 16), const SizedBox(height: 16),
_sectionTitle(Icons.edit_calendar, "Planned Work"), _sectionTitle(Icons.edit_calendar, "Planned Work"),
@ -86,18 +91,22 @@ SafeArea(
maxLines: 3, maxLines: 3,
), ),
const SizedBox(height: 16), const SizedBox(height: 16),
_sectionTitle(Icons.category_outlined, "Selected Work Category"), _sectionTitle(
Icons.category_outlined, "Selected Work Category"),
const SizedBox(height: 6), const SizedBox(height: 6),
Obx(() { Obx(() {
final categoryMap = controller.categoryIdNameMap; final categoryMap = controller.categoryIdNameMap;
final String selectedName = final String selectedName =
controller.selectedCategoryId.value != null controller.selectedCategoryId.value != null
? (categoryMap[controller.selectedCategoryId.value!] ?? 'Select Category') ? (categoryMap[controller
.selectedCategoryId.value!] ??
'Select Category')
: 'Select Category'; : 'Select Category';
return Container( return Container(
width: double.infinity, width: double.infinity,
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 14), padding: const EdgeInsets.symmetric(
horizontal: 12, vertical: 14),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.grey.shade100, color: Colors.grey.shade100,
border: Border.all(color: Colors.grey.shade300), border: Border.all(color: Colors.grey.shade300),
@ -118,11 +127,13 @@ SafeArea(
) )
.toList(), .toList(),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [ children: [
Text( Text(
selectedName, selectedName,
style: const TextStyle(fontSize: 14, color: Colors.black87), style: const TextStyle(
fontSize: 14, color: Colors.black87),
), ),
const Icon(Icons.arrow_drop_down), const Icon(Icons.arrow_drop_down),
], ],
@ -137,10 +148,12 @@ SafeArea(
child: OutlinedButton.icon( child: OutlinedButton.icon(
onPressed: () => Get.back(), onPressed: () => Get.back(),
icon: const Icon(Icons.close, size: 18), icon: const Icon(Icons.close, size: 18),
label: MyText.bodyMedium("Cancel", fontWeight: 600), label: MyText.bodyMedium("Cancel",
fontWeight: 600),
style: OutlinedButton.styleFrom( style: OutlinedButton.styleFrom(
side: const BorderSide(color: Colors.grey), side: const BorderSide(color: Colors.grey),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)), shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10)),
), ),
), ),
), ),
@ -148,9 +161,13 @@ SafeArea(
Expanded( Expanded(
child: ElevatedButton.icon( child: ElevatedButton.icon(
onPressed: () async { onPressed: () async {
final plannedValue = int.tryParse(plannedTaskController.text.trim()) ?? 0; final plannedValue = int.tryParse(
final comment = descriptionController.text.trim(); plannedTaskController.text.trim()) ??
final selectedCategoryId = controller.selectedCategoryId.value; 0;
final comment =
descriptionController.text.trim();
final selectedCategoryId =
controller.selectedCategoryId.value;
if (selectedCategoryId == null) { if (selectedCategoryId == null) {
showAppSnackbar( showAppSnackbar(
title: "error", title: "error",
@ -171,7 +188,8 @@ SafeArea(
if (success) { if (success) {
Get.back(); Get.back();
Future.delayed(const Duration(milliseconds: 300), () { Future.delayed(
const Duration(milliseconds: 300), () {
onSubmit(); onSubmit();
showAppSnackbar( showAppSnackbar(
title: "Success", title: "Success",
@ -182,10 +200,12 @@ SafeArea(
} }
}, },
icon: const Icon(Icons.check, size: 18), icon: const Icon(Icons.check, size: 18),
label: MyText.bodyMedium("Submit", color: Colors.white, fontWeight: 600), label: MyText.bodyMedium("Submit",
color: Colors.white, fontWeight: 600),
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
backgroundColor: Colors.blueAccent, backgroundColor: Colors.blueAccent,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)), shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10)),
), ),
), ),
), ),
@ -196,7 +216,7 @@ SafeArea(
), ),
), ),
), ),
); );
}, },
); );
}, },
@ -204,6 +224,7 @@ SafeArea(
isScrollControlled: true, isScrollControlled: true,
); );
} }
Widget _sectionTitle(IconData icon, String title) { Widget _sectionTitle(IconData icon, String title) {
return Row( return Row(
children: [ children: [