feat: add noOfPersons input field in AddExpenseBottomSheet for enhanced expense entry
This commit is contained in:
parent
2b34635a75
commit
cef3bd8a1e
@ -26,6 +26,7 @@ class AddExpenseController extends GetxController {
|
||||
final gstController = TextEditingController();
|
||||
final locationController = TextEditingController();
|
||||
final transactionDateController = TextEditingController();
|
||||
final TextEditingController noOfPersonsController = TextEditingController();
|
||||
|
||||
// === State Controllers ===
|
||||
final RxBool isLoading = false.obs;
|
||||
@ -72,6 +73,7 @@ class AddExpenseController extends GetxController {
|
||||
gstController.dispose();
|
||||
locationController.dispose();
|
||||
transactionDateController.dispose();
|
||||
noOfPersonsController.dispose();
|
||||
super.onClose();
|
||||
}
|
||||
|
||||
@ -244,7 +246,9 @@ class AddExpenseController extends GetxController {
|
||||
location: locationController.text,
|
||||
supplerName: supplierController.text,
|
||||
amount: amount,
|
||||
noOfPersons: 0,
|
||||
noOfPersons: selectedExpenseType.value?.noOfPersonsRequired == true
|
||||
? int.tryParse(noOfPersonsController.text.trim()) ?? 0
|
||||
: 0,
|
||||
billAttachments: billAttachments,
|
||||
);
|
||||
|
||||
|
@ -125,6 +125,28 @@ class _AddExpenseBottomSheetState extends State<_AddExpenseBottomSheet> {
|
||||
(val) => controller.selectedExpenseType.value = val,
|
||||
),
|
||||
),
|
||||
if (controller
|
||||
.selectedExpenseType.value?.noOfPersonsRequired ==
|
||||
true)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
_SectionTitle(
|
||||
icon: Icons.people_outline,
|
||||
title: "No. of Persons",
|
||||
requiredField: true,
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
_CustomTextField(
|
||||
controller: controller.noOfPersonsController,
|
||||
hint: "Enter No. of Persons",
|
||||
keyboardType: TextInputType.number,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
_SectionTitle(
|
||||
icon: Icons.confirmation_number_outlined,
|
||||
|
Loading…
x
Reference in New Issue
Block a user