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

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