policy validation

This commit is contained in:
venbaittech 2025-12-12 19:31:59 +05:30
parent dcbf177dde
commit dda10c8d91
4 changed files with 435 additions and 122 deletions

File diff suppressed because one or more lines are too long

View File

@ -17,3 +17,4 @@ final dashboardKeyProvider = StateProvider<int?>((ref) => null);
final dashboardStatusProvider = StateProvider<String?>((ref) => null);
final dashboardStaffIdProvider = StateProvider<String?>((ref) => null);
final enquiryRefreshProvider = StateProvider<bool>((ref) => false);
final policyDataAcurancyRefreshProvider = StateProvider<bool>((ref) => false);

View File

@ -47,6 +47,7 @@ class policylistState extends ConsumerState<policylist> {
dynamic choosedPolcyId;
PlatformFile? docPDFUploadedFile;
String? selectedPDFFileNames;
late ProviderSubscription<bool> refreshSub;
@override
void initState() {
@ -67,6 +68,19 @@ class policylistState extends ConsumerState<policylist> {
if (userId != null) {
getStaffList(managerId!, userId, roleId);
}
refreshSub = ref.listenManual<bool>(policyDataAcurancyRefreshProvider, (
previous,
next,
) {
if (next == true) {
print('refresh triggered Quick Creation');
// callRefresh();
getStaffList(managerId!, userId, roleId);
ref.read(policyDataAcurancyRefreshProvider.notifier).state = false;
}
});
});
}

View File

@ -73,7 +73,6 @@ class _policyValidationState extends ConsumerState<policyValidation> {
String? pdfUrl; // full file path from API
// --- Controllers (all editable fields)
late TextEditingController policyNumberController;
late TextEditingController insuredNameController;
@ -174,7 +173,8 @@ class _policyValidationState extends ConsumerState<policyValidation> {
rtoCityCodeController.text = item['rto_city_code']?.toString() ?? '';
weightController.text = item['weight']?.toString() ?? '';
fuelTypeController.text = item['fuel_type']?.toString() ?? '';
registrationDateController.text = item['date_of_registration']?.toString() ?? '';
registrationDateController.text =
item['date_of_registration']?.toString() ?? '';
yomController.text = item['year_of_manufacture']?.toString() ?? '';
engineNoController.text = item['engine_no']?.toString() ?? '';
@ -185,7 +185,8 @@ class _policyValidationState extends ConsumerState<policyValidation> {
vehicleTypeController.text = item['vehicle_type']?.toString() ?? '';
brokerNameController.text = item['broker_name']?.toString() ?? '';
commissionAmountController.text = item['commission_amount']?.toString() ?? '';
commissionAmountController.text =
item['commission_amount']?.toString() ?? '';
// read providers + call APIs
Future.microtask(() {
@ -265,19 +266,22 @@ class _policyValidationState extends ConsumerState<policyValidation> {
setState(() => isLoading = true);
try {
final url = Uri.parse('${Env
.apiUrl}policy/PolicyFilePath?policy_id=$policyId&file_type=policy_pdf');
final url = Uri.parse(
'${Env.apiUrl}policy/PolicyFilePath?policy_id=$policyId&file_type=policy_pdf',
);
setState(() {
pdfUrl = "$url";
});
setState(() {
pdfUrl = "$url";
});
final response = await apiService.policyFilePathApi(policyId, 'policy_pdf');
final response = await apiService.policyFilePathApi(
policyId,
'policy_pdf',
);
debugPrint('policyFilePathApi response: $response');
if (response != null && response['status'] == 'success') {
// final filePath = response['data']?.toString();
//
// // The API returns a server absolute path like:
@ -299,7 +303,9 @@ class _policyValidationState extends ConsumerState<policyValidation> {
// debugPrint("FINAL PDF URL -> $pdfUrl");
// }
} else {
debugPrint('policyFilePathApi returned error: ${response?['message'] ?? 'unknown'}');
debugPrint(
'policyFilePathApi returned error: ${response?['message'] ?? 'unknown'}',
);
}
} catch (e, st) {
debugPrint('Exception in getPolicyFilePath: $e\n$st');
@ -329,15 +335,23 @@ class _policyValidationState extends ConsumerState<policyValidation> {
if (!mounted) return;
setState(() {
// update controllers (overwrite with authoritative API values)
policyNumberController.text = data['policy_number']?.toString() ?? policyNumberController.text;
insuredNameController.text = data['insured_name']?.toString() ?? insuredNameController.text;
premiumController.text = data['premium_amount']?.toString() ?? premiumController.text;
remarksController.text = data['remarks']?.toString() ?? remarksController.text;
policyNumberController.text =
data['policy_number']?.toString() ?? policyNumberController.text;
insuredNameController.text =
data['insured_name']?.toString() ?? insuredNameController.text;
premiumController.text =
data['premium_amount']?.toString() ?? premiumController.text;
remarksController.text =
data['remarks']?.toString() ?? remarksController.text;
rcNoController.text = data['rc_no']?.toString() ?? rcNoController.text;
issuedDateController.text = data['issued_date']?.toString() ?? issuedDateController.text;
startDateController.text = data['start_date']?.toString() ?? startDateController.text;
endDateController.text = data['end_date']?.toString() ?? endDateController.text;
rcNoController.text =
data['rc_no']?.toString() ?? rcNoController.text;
issuedDateController.text =
data['issued_date']?.toString() ?? issuedDateController.text;
startDateController.text =
data['start_date']?.toString() ?? startDateController.text;
endDateController.text =
data['end_date']?.toString() ?? endDateController.text;
tpController.text = data['tp']?.toString() ?? tpController.text;
odController.text = data['od']?.toString() ?? odController.text;
@ -346,25 +360,43 @@ class _policyValidationState extends ConsumerState<policyValidation> {
sgstController.text = data['sgst']?.toString() ?? sgstController.text;
igstController.text = data['igst']?.toString() ?? igstController.text;
rtoStateCodeController.text = data['rto_state_code']?.toString() ?? rtoStateCodeController.text;
rtoCityCodeController.text = data['rto_city_code']?.toString() ?? rtoCityCodeController.text;
weightController.text = data['weight']?.toString() ?? weightController.text;
fuelTypeController.text = data['fuel_type']?.toString() ?? fuelTypeController.text;
registrationDateController.text = data['date_of_registration']?.toString() ?? registrationDateController.text;
yomController.text = data['year_of_manufacture']?.toString() ?? yomController.text;
rtoStateCodeController.text =
data['rto_state_code']?.toString() ?? rtoStateCodeController.text;
rtoCityCodeController.text =
data['rto_city_code']?.toString() ?? rtoCityCodeController.text;
weightController.text =
data['weight']?.toString() ?? weightController.text;
fuelTypeController.text =
data['fuel_type']?.toString() ?? fuelTypeController.text;
registrationDateController.text =
data['date_of_registration']?.toString() ??
registrationDateController.text;
yomController.text =
data['year_of_manufacture']?.toString() ?? yomController.text;
engineNoController.text = data['engine_no']?.toString() ?? engineNoController.text;
chassisNoController.text = data['chassis_no']?.toString() ?? chassisNoController.text;
engineNoController.text =
data['engine_no']?.toString() ?? engineNoController.text;
chassisNoController.text =
data['chassis_no']?.toString() ?? chassisNoController.text;
makeController.text = data['make']?.toString() ?? makeController.text;
modelController.text = data['model']?.toString() ?? modelController.text;
cubicCapacityController.text = data['cubic_capacity']?.toString() ?? cubicCapacityController.text;
vehicleTypeController.text = data['vehicle_type']?.toString() ?? vehicleTypeController.text;
modelController.text =
data['model']?.toString() ?? modelController.text;
cubicCapacityController.text =
data['cubic_capacity']?.toString() ??
cubicCapacityController.text;
vehicleTypeController.text =
data['vehicle_type']?.toString() ?? vehicleTypeController.text;
brokerNameController.text = data['broker_name']?.toString() ?? brokerNameController.text;
commissionAmountController.text = data['commission_amount']?.toString() ?? commissionAmountController.text;
brokerNameController.text =
data['broker_name']?.toString() ?? brokerNameController.text;
commissionAmountController.text =
data['commission_amount']?.toString() ??
commissionAmountController.text;
});
} else {
debugPrint('findPolicyApi returned error: ${response?['message'] ?? 'unknown'}');
debugPrint(
'findPolicyApi returned error: ${response?['message'] ?? 'unknown'}',
);
}
} catch (e, st) {
debugPrint('Exception in getFindPolicy: $e\n$st');
@ -374,7 +406,10 @@ class _policyValidationState extends ConsumerState<policyValidation> {
}
}
Future<void> _pickDate(TextEditingController controller, BuildContext context) async {
Future<void> _pickDate(
TextEditingController controller,
BuildContext context,
) async {
DateTime initial = DateTime.now();
try {
if (controller.text.isNotEmpty) {
@ -395,7 +430,8 @@ class _policyValidationState extends ConsumerState<policyValidation> {
lastDate: DateTime(2100),
);
if (picked != null) {
controller.text = "${picked.day.toString().padLeft(2,'0')}-${picked.month.toString().padLeft(2,'0')}-${picked.year}";
controller.text =
"${picked.day.toString().padLeft(2, '0')}-${picked.month.toString().padLeft(2, '0')}-${picked.year}";
}
}
@ -421,21 +457,43 @@ class _policyValidationState extends ConsumerState<policyValidation> {
"cgst": cgstController.text.isEmpty ? null : cgstController.text,
"sgst": sgstController.text.isEmpty ? null : sgstController.text,
"igst": igstController.text.isEmpty ? null : igstController.text,
"rto_state_code": rtoStateCodeController.text.isEmpty ? null : rtoStateCodeController.text,
"rto_city_code": rtoCityCodeController.text.isEmpty ? null : rtoCityCodeController.text,
"rto_state_code": rtoStateCodeController.text.isEmpty
? null
: rtoStateCodeController.text,
"rto_city_code": rtoCityCodeController.text.isEmpty
? null
: rtoCityCodeController.text,
"weight": weightController.text.isEmpty ? null : weightController.text,
"fuel_type": fuelTypeController.text.isEmpty ? null : fuelTypeController.text,
"date_of_registration": registrationDateController.text.isEmpty ? null : registrationDateController.text,
"year_of_manufacture": yomController.text.isEmpty ? null : yomController.text,
"engine_no": engineNoController.text.isEmpty ? null : engineNoController.text,
"chassis_no": chassisNoController.text.isEmpty ? null : chassisNoController.text,
"fuel_type": fuelTypeController.text.isEmpty
? null
: fuelTypeController.text,
"date_of_registration": registrationDateController.text.isEmpty
? null
: registrationDateController.text,
"year_of_manufacture": yomController.text.isEmpty
? null
: yomController.text,
"engine_no": engineNoController.text.isEmpty
? null
: engineNoController.text,
"chassis_no": chassisNoController.text.isEmpty
? null
: chassisNoController.text,
"make": makeController.text.isEmpty ? null : makeController.text,
"model": modelController.text.isEmpty ? null : modelController.text,
"cubic_capacity": cubicCapacityController.text.isEmpty ? null : cubicCapacityController.text,
"vehicle_type": vehicleTypeController.text.isEmpty ? null : vehicleTypeController.text,
"broker_name": brokerNameController.text.isEmpty ? null : brokerNameController.text,
"commission_amount": commissionAmountController.text.isEmpty ? null : commissionAmountController.text,
"updated_by": userId
"cubic_capacity": cubicCapacityController.text.isEmpty
? null
: cubicCapacityController.text,
"vehicle_type": vehicleTypeController.text.isEmpty
? null
: vehicleTypeController.text,
"broker_name": brokerNameController.text.isEmpty
? null
: brokerNameController.text,
"commission_amount": commissionAmountController.text.isEmpty
? null
: commissionAmountController.text,
"updated_by": userId,
};
if (!mounted) return;
@ -451,10 +509,20 @@ class _policyValidationState extends ConsumerState<policyValidation> {
setState(() => isLoading = false);
context.pop();
ToastHelper.showSuccessToast(context, "Policy updated successfully");
WidgetsBinding.instance.addPostFrameCallback((_) {
// Now safe to do navigation + provider updates
final container = ProviderScope.containerOf(context);
container.read(policyDataAcurancyRefreshProvider.notifier).state =
true;
});
} else {
if (!mounted) return;
setState(() => isLoading = false);
ToastHelper.showErrorToast(context, result?['message']?.toString() ?? 'Error updating policy');
ToastHelper.showErrorToast(
context,
result?['message']?.toString() ?? 'Error updating policy',
);
}
} catch (e, st) {
debugPrint('Exception in updatePolicy: $e\n$st');
@ -491,9 +559,13 @@ class _policyValidationState extends ConsumerState<policyValidation> {
);
}
Widget _buildInput(String label, TextEditingController controller, {TextInputType keyboardType = TextInputType.text, bool readOnly = false, VoidCallback? onTap}) {
Widget _buildInput(
String label,
TextEditingController controller, {
TextInputType keyboardType = TextInputType.text,
bool readOnly = false,
VoidCallback? onTap,
}) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -526,16 +598,18 @@ class _policyValidationState extends ConsumerState<policyValidation> {
padding: const EdgeInsets.all(16),
color: const Color(0xFFF7FBFA),
child: Row(
mainAxisAlignment: MainAxisAlignment.end, // 👉 move button to right
mainAxisAlignment: MainAxisAlignment.end, // 👉 move button to right
children: [
ElevatedButton(
onPressed: widget.item?['is_data_accuracy_checked'] == '1' ? null : _save,
onPressed: widget.item?['is_data_accuracy_checked'] == '1'
? null
: _save,
style: ElevatedButton.styleFrom(
backgroundColor: const Color(0xFF2E7D6E),
foregroundColor: Colors.white,
padding: const EdgeInsets.symmetric(
vertical: 10,
horizontal: 20, // 👉 smaller width
horizontal: 20, // 👉 smaller width
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
@ -543,10 +617,7 @@ class _policyValidationState extends ConsumerState<policyValidation> {
),
child: const Text(
'Confirm Data Accuracy',
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600),
),
),
],
@ -566,11 +637,30 @@ class _policyValidationState extends ConsumerState<policyValidation> {
padding: const EdgeInsets.symmetric(horizontal: 12),
child: Row(
children: [
IconButton(icon: const Icon(Icons.file_open), onPressed: () => context.pop()),
const Expanded(child: Text('Insurance Policy Review', style: TextStyle(fontSize: 18, fontWeight: FontWeight.w600))),
if (isLoading) const SizedBox(width: 12, height: 12, child: CircularProgressIndicator(strokeWidth: 2)),
IconButton(
icon: const Icon(Icons.file_open),
onPressed: () => context.pop(),
),
const Expanded(
child: Text(
'Insurance Policy Review',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w600,
),
),
),
if (isLoading)
const SizedBox(
width: 12,
height: 12,
child: CircularProgressIndicator(strokeWidth: 2),
),
const SizedBox(width: 8),
IconButton(icon: const Icon(Icons.close), onPressed: () => context.pop()),
IconButton(
icon: const Icon(Icons.close),
onPressed: () => context.pop(),
),
],
),
),
@ -597,7 +687,10 @@ class _policyValidationState extends ConsumerState<policyValidation> {
children: [
const Text(
'Orginal Policy Document',
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600),
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
),
),
const SizedBox(height: 8),
@ -606,32 +699,34 @@ class _policyValidationState extends ConsumerState<policyValidation> {
future: loadNetworkPdfBytes(pdfUrl!),
builder: (context, snapshot) {
if (!snapshot.hasData) {
return const Center(child: CircularProgressIndicator());
return const Center(
child: CircularProgressIndicator(),
);
}
final pdfBytes = snapshot.data!;
return PdfDocumentLoader.openData(
pdfBytes,
documentBuilder: (context, pdfDocument, pageCount) {
return ListView.builder(
itemCount: pageCount,
itemBuilder: (context, index) {
return Container(
color: Colors.black12,
child: PdfPageView(
pdfDocument: pdfDocument,
pageNumber: index + 1,
),
documentBuilder:
(context, pdfDocument, pageCount) {
return ListView.builder(
itemCount: pageCount,
itemBuilder: (context, index) {
return Container(
color: Colors.black12,
child: PdfPageView(
pdfDocument: pdfDocument,
pageNumber: index + 1,
),
);
},
);
},
);
},
);
},
),
)
),
// Expanded(
// child: PdfDocumentLoader.openAsset(
@ -672,40 +767,97 @@ class _policyValidationState extends ConsumerState<policyValidation> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
// Policy Details
Card(
elevation: 5,
color: Colors.white,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
crossAxisAlignment:
CrossAxisAlignment.stretch,
children: [
_sectionHeader('Policy Details', icon: Icons.policy),
_sectionHeader(
'Policy Details',
icon: Icons.policy,
),
SizedBox(height: 10),
Row(
children: [
Expanded(child: _buildInput('Policy Number', policyNumberController)),
Expanded(
child: _buildInput(
'Policy Number',
policyNumberController,
),
),
const SizedBox(width: 8),
Expanded(child: _buildInput('Insured Name', insuredNameController)),
Expanded(
child: _buildInput(
'Insured Name',
insuredNameController,
),
),
],
),
Row(
children: [
Expanded(child: _buildInput('Issued Date', issuedDateController, readOnly: true, onTap: () => _pickDate(issuedDateController, context))),
Expanded(
child: _buildInput(
'Issued Date',
issuedDateController,
readOnly: true,
onTap: () => _pickDate(
issuedDateController,
context,
),
),
),
const SizedBox(width: 8),
Expanded(child: _buildInput('Start Date', startDateController, readOnly: true, onTap: () => _pickDate(startDateController, context))),
Expanded(
child: _buildInput(
'Start Date',
startDateController,
readOnly: true,
onTap: () => _pickDate(
startDateController,
context,
),
),
),
const SizedBox(width: 8),
Expanded(child: _buildInput('End Date', endDateController, readOnly: true, onTap: () => _pickDate(endDateController, context)),)
Expanded(
child: _buildInput(
'End Date',
endDateController,
readOnly: true,
onTap: () => _pickDate(
endDateController,
context,
),
),
),
],
),
Row(
children: [
Expanded(child: _buildInput('Premium Amount', premiumController, keyboardType: TextInputType.number)),
Expanded(
child: _buildInput(
'Premium Amount',
premiumController,
keyboardType:
TextInputType.number,
),
),
const SizedBox(width: 8),
Expanded(child: _buildInput('Remarks', remarksController)),
Expanded(
child: _buildInput(
'Remarks',
remarksController,
),
),
],
),
],
@ -719,31 +871,78 @@ class _policyValidationState extends ConsumerState<policyValidation> {
Card(
elevation: 5,
color: Colors.white,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
crossAxisAlignment:
CrossAxisAlignment.stretch,
children: [
_sectionHeader('Tax / Cover Details', icon: Icons.attach_money),
_sectionHeader(
'Tax / Cover Details',
icon: Icons.attach_money,
),
SizedBox(height: 10),
Row(
children: [
Expanded(child: _buildInput('TP', tpController, keyboardType: TextInputType.number)),
Expanded(
child: _buildInput(
'TP',
tpController,
keyboardType:
TextInputType.number,
),
),
const SizedBox(width: 8),
Expanded(child: _buildInput('OD', odController, keyboardType: TextInputType.number)),
Expanded(
child: _buildInput(
'OD',
odController,
keyboardType:
TextInputType.number,
),
),
const SizedBox(width: 8),
Expanded(child: _buildInput('PA', paController, keyboardType: TextInputType.number)),
Expanded(
child: _buildInput(
'PA',
paController,
keyboardType:
TextInputType.number,
),
),
],
),
Row(
children: [
Expanded(child: _buildInput('CGST', cgstController, keyboardType: TextInputType.number)),
Expanded(
child: _buildInput(
'CGST',
cgstController,
keyboardType:
TextInputType.number,
),
),
const SizedBox(width: 8),
Expanded(child: _buildInput('SGST', sgstController, keyboardType: TextInputType.number)),
Expanded(
child: _buildInput(
'SGST',
sgstController,
keyboardType:
TextInputType.number,
),
),
const SizedBox(width: 8),
Expanded(child: _buildInput('IGST', igstController, keyboardType: TextInputType.number)),
Expanded(
child: _buildInput(
'IGST',
igstController,
keyboardType:
TextInputType.number,
),
),
],
),
],
@ -757,48 +956,127 @@ class _policyValidationState extends ConsumerState<policyValidation> {
Card(
elevation: 5,
color: Colors.white,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
crossAxisAlignment:
CrossAxisAlignment.stretch,
children: [
_sectionHeader('Vehicle Details', icon: Icons.directions_car),
_sectionHeader(
'Vehicle Details',
icon: Icons.directions_car,
),
SizedBox(height: 10),
Row(
children: [
Expanded(child: _buildInput('RTO State Name', rtoStateCodeController)),
Expanded(
child: _buildInput(
'RTO State Name',
rtoStateCodeController,
),
),
const SizedBox(width: 8),
Expanded(child: _buildInput('RTO City Code', rtoCityCodeController)),
Expanded(
child: _buildInput(
'RTO City Code',
rtoCityCodeController,
),
),
const SizedBox(width: 8),
Expanded(child: _buildInput('Weight', weightController, keyboardType: TextInputType.number)),
Expanded(
child: _buildInput(
'Weight',
weightController,
keyboardType:
TextInputType.number,
),
),
],
),
Row(
children: [
Expanded(child: _buildInput('Fuel Type', fuelTypeController)),
Expanded(
child: _buildInput(
'Fuel Type',
fuelTypeController,
),
),
const SizedBox(width: 8),
Expanded(child: _buildInput('Date of Registration', registrationDateController, readOnly: true, onTap: () => _pickDate(registrationDateController, context))),
Expanded(
child: _buildInput(
'Date of Registration',
registrationDateController,
readOnly: true,
onTap: () => _pickDate(
registrationDateController,
context,
),
),
),
const SizedBox(width: 8),
Expanded(child: _buildInput('Year of Manufacture', yomController, keyboardType: TextInputType.number)),
Expanded(
child: _buildInput(
'Year of Manufacture',
yomController,
keyboardType:
TextInputType.number,
),
),
],
),
Row(
children: [
Expanded(child: _buildInput('Engine No', engineNoController)),
Expanded(
child: _buildInput(
'Engine No',
engineNoController,
),
),
const SizedBox(width: 8),
Expanded(child: _buildInput('Chassis No', chassisNoController)),
Expanded(
child: _buildInput(
'Chassis No',
chassisNoController,
),
),
const SizedBox(width: 8),
Expanded(child: Expanded(child: _buildInput('Make', makeController))),
Expanded(
child: Expanded(
child: _buildInput(
'Make',
makeController,
),
),
),
],
),
Row(
children: [
Expanded(child: _buildInput('Model', modelController)),
Expanded(
child: _buildInput(
'Model',
modelController,
),
),
const SizedBox(width: 8),
Expanded(child: _buildInput('Cubic Capacity', cubicCapacityController, keyboardType: TextInputType.number)),
Expanded(
child: _buildInput(
'Cubic Capacity',
cubicCapacityController,
keyboardType:
TextInputType.number,
),
),
const SizedBox(width: 8),
Expanded(child: _buildInput('Vehicle Type', vehicleTypeController)),
Expanded(
child: _buildInput(
'Vehicle Type',
vehicleTypeController,
),
),
],
),
],
@ -812,19 +1090,37 @@ class _policyValidationState extends ConsumerState<policyValidation> {
Card(
elevation: 5,
color: Colors.white,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
crossAxisAlignment:
CrossAxisAlignment.stretch,
children: [
_sectionHeader('Broker / Commission', icon: Icons.person),
_sectionHeader(
'Broker / Commission',
icon: Icons.person,
),
SizedBox(height: 10),
Row(
children: [
Expanded(child: _buildInput('Broker Name', brokerNameController)),
Expanded(
child: _buildInput(
'Broker Name',
brokerNameController,
),
),
const SizedBox(width: 8),
Expanded(child: _buildInput('Commission Amount', commissionAmountController, keyboardType: TextInputType.number)),
Expanded(
child: _buildInput(
'Commission Amount',
commissionAmountController,
keyboardType:
TextInputType.number,
),
),
],
),
],
@ -832,13 +1128,15 @@ class _policyValidationState extends ConsumerState<policyValidation> {
),
),
const SizedBox(height: 20),// spacing above fixed button
const SizedBox(
height: 20,
), // spacing above fixed button
],
),
),
),
),
)
),
],
),
),