quick_proceed status_changes
This commit is contained in:
parent
485894ba98
commit
fcdc9da609
File diff suppressed because one or more lines are too long
@ -30,6 +30,7 @@ import '../../presentation/screens/splash/splash_screen.dart';
|
|||||||
import '../../presentation/screens/staff/Enquiry/enquiry_inline_Edit_17Nov.dart';
|
import '../../presentation/screens/staff/Enquiry/enquiry_inline_Edit_17Nov.dart';
|
||||||
import '../../presentation/screens/staff/Enquiry/enquiry_inline_list.dart';
|
import '../../presentation/screens/staff/Enquiry/enquiry_inline_list.dart';
|
||||||
import '../../presentation/screens/staff/Enquiry/enquiry_list.dart';
|
import '../../presentation/screens/staff/Enquiry/enquiry_list.dart';
|
||||||
|
import '../../presentation/screens/staff/Enquiry/staff_policy.dart';
|
||||||
import '../../presentation/screens/staff/policy/policy.dart';
|
import '../../presentation/screens/staff/policy/policy.dart';
|
||||||
import '../../presentation/screens/staff/policy/policy_list.dart';
|
import '../../presentation/screens/staff/policy/policy_list.dart';
|
||||||
import '../../presentation/screens/staff/quotations/quotation.dart';
|
import '../../presentation/screens/staff/quotations/quotation.dart';
|
||||||
@ -176,6 +177,11 @@ final GoRouter appRouter = GoRouter(
|
|||||||
builder: (context, state) => const PolicyScreen(),
|
builder: (context, state) => const PolicyScreen(),
|
||||||
),
|
),
|
||||||
|
|
||||||
|
GoRoute(
|
||||||
|
path: AppRoutes.policyStaffEnq,
|
||||||
|
builder: (context, state) => PolicyStaffEnqList(),
|
||||||
|
),
|
||||||
|
|
||||||
GoRoute(
|
GoRoute(
|
||||||
path: AppRoutes.enquiryForStaff,
|
path: AppRoutes.enquiryForStaff,
|
||||||
builder: (context, state) => const EnquiryListStaffInline(),
|
builder: (context, state) => const EnquiryListStaffInline(),
|
||||||
|
|||||||
@ -21,6 +21,7 @@ class AppRoutes {
|
|||||||
static const String policylist = '/policylist';
|
static const String policylist = '/policylist';
|
||||||
static const String quotation = '/QuotationScreen';
|
static const String quotation = '/QuotationScreen';
|
||||||
static const String policy = '/PolicyScreen';
|
static const String policy = '/PolicyScreen';
|
||||||
|
static const String policyStaffEnq = '/policyStaffEnq';
|
||||||
|
|
||||||
static const String payout = '/payout';
|
static const String payout = '/payout';
|
||||||
static const String invoiceList = '/invoiceList';
|
static const String invoiceList = '/invoiceList';
|
||||||
|
|||||||
@ -576,6 +576,8 @@ class ApiService {
|
|||||||
|
|
||||||
Future<Map<String, dynamic>> fetchStaffUserList(int managerId, role) async {
|
Future<Map<String, dynamic>> fetchStaffUserList(int managerId, role) async {
|
||||||
// print(_token);
|
// print(_token);
|
||||||
|
|
||||||
|
print('rolemanagerId - $managerId');
|
||||||
if (_token == null) {
|
if (_token == null) {
|
||||||
await _initializeToken();
|
await _initializeToken();
|
||||||
}
|
}
|
||||||
@ -587,6 +589,7 @@ class ApiService {
|
|||||||
dynamic url;
|
dynamic url;
|
||||||
if (role == 'manager') {
|
if (role == 'manager') {
|
||||||
print('manager');
|
print('manager');
|
||||||
|
// url = Uri.parse('${Env.apiUrl}staff/staffList');
|
||||||
url = Uri.parse('${Env.apiUrl}staff/staffList?manager_id=${managerId}');
|
url = Uri.parse('${Env.apiUrl}staff/staffList?manager_id=${managerId}');
|
||||||
} else {
|
} else {
|
||||||
print('handler');
|
print('handler');
|
||||||
@ -770,6 +773,22 @@ class ApiService {
|
|||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<Map<String, dynamic>> updateEnquiryInProgress(id) async {
|
||||||
|
// print(_token);
|
||||||
|
if (_token == null) {
|
||||||
|
await _initializeToken();
|
||||||
|
}
|
||||||
|
final url = Uri.parse(
|
||||||
|
'${Env.apiUrl}enquiry/updateEnquiryInProgress?enquiry_id=$id',
|
||||||
|
);
|
||||||
|
final headers = {
|
||||||
|
'Authorization': 'Bearer $_token' ?? '',
|
||||||
|
'app-signature': Env.App_Signature,
|
||||||
|
};
|
||||||
|
final response = await _makeGetRequest(url, headers);
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
Future<Map<String, dynamic>> findEnqQuotePolicyView(id) async {
|
Future<Map<String, dynamic>> findEnqQuotePolicyView(id) async {
|
||||||
print('findEnqQuotePolicyVie2w - $id');
|
print('findEnqQuotePolicyVie2w - $id');
|
||||||
if (_token == null) {
|
if (_token == null) {
|
||||||
|
|||||||
@ -384,11 +384,11 @@ class _AppHeaderState extends ConsumerState<AppHeader> {
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
SideDrawerPanel.show(
|
SideDrawerPanel.show(
|
||||||
context: context,
|
context: context,
|
||||||
title: 'Proposal Creation',
|
title: 'Quote Creation',
|
||||||
child: CreateProposal_Quick(),
|
child: CreateProposal_Quick(),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
tooltip: 'Create Proposal',
|
tooltip: 'Quick Quote',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|||||||
@ -135,7 +135,12 @@ class MainLayoutState extends ConsumerState<MainLayout> {
|
|||||||
// debugPrint("Notifications tapped");
|
// debugPrint("Notifications tapped");
|
||||||
// },
|
// },
|
||||||
// ),
|
// ),
|
||||||
appBar: AppHeader(),
|
// appBar: AppHeader(),
|
||||||
|
appBar: PreferredSize(
|
||||||
|
preferredSize: AppHeader().preferredSize,
|
||||||
|
child: ExcludeFocus(child: AppHeader()),
|
||||||
|
),
|
||||||
|
|
||||||
body: Row(
|
body: Row(
|
||||||
children: [
|
children: [
|
||||||
// AnimatedContainer(
|
// AnimatedContainer(
|
||||||
|
|||||||
@ -97,6 +97,8 @@ class CreateProposal_QuickFormState
|
|||||||
|
|
||||||
List<String> tabHeader = ['idv', 'premium_Amount', 'insurer', 'regNo'];
|
List<String> tabHeader = ['idv', 'premium_Amount', 'insurer', 'regNo'];
|
||||||
|
|
||||||
|
late FocusNode partnerFocusNode;
|
||||||
|
|
||||||
List<QuotationRow> rows = [];
|
List<QuotationRow> rows = [];
|
||||||
|
|
||||||
List<Map<String, dynamic>> getBrokerData = [];
|
List<Map<String, dynamic>> getBrokerData = [];
|
||||||
@ -125,6 +127,8 @@ class CreateProposal_QuickFormState
|
|||||||
dynamic userId;
|
dynamic userId;
|
||||||
dynamic managerId;
|
dynamic managerId;
|
||||||
|
|
||||||
|
bool isSingleSave = false;
|
||||||
|
|
||||||
List<Map<String, dynamic>> quotationList = [];
|
List<Map<String, dynamic>> quotationList = [];
|
||||||
|
|
||||||
Map<String, dynamic> quotationData() {
|
Map<String, dynamic> quotationData() {
|
||||||
@ -153,7 +157,8 @@ class CreateProposal_QuickFormState
|
|||||||
|
|
||||||
// "vehicle_type_id": selectedVehicleType,
|
// "vehicle_type_id": selectedVehicleType,
|
||||||
"is_quick_quote": "1",
|
"is_quick_quote": "1",
|
||||||
"quotation": quotationList,
|
// "quotation": quotationList,
|
||||||
|
"quotation": jsonEncode(quotationList),
|
||||||
// "is_data_created_by_handler": roleId == 'handler' ? '1' : '0',
|
// "is_data_created_by_handler": roleId == 'handler' ? '1' : '0',
|
||||||
// "is_data_created_by_manager": roleId == 'manager' ? '1' : '0',
|
// "is_data_created_by_manager": roleId == 'manager' ? '1' : '0',
|
||||||
"is_data_created_by_staff": roleId != null ? '1' : '0',
|
"is_data_created_by_staff": roleId != null ? '1' : '0',
|
||||||
@ -163,6 +168,7 @@ class CreateProposal_QuickFormState
|
|||||||
// "previous_policy_file_name": "previous_policy.pdf",
|
// "previous_policy_file_name": "previous_policy.pdf",
|
||||||
"remarks": controllers["remarks"]?.text,
|
"remarks": controllers["remarks"]?.text,
|
||||||
// "assigned_to": (roleId == 'staff') ? userId : selectedStaff,
|
// "assigned_to": (roleId == 'staff') ? userId : selectedStaff,
|
||||||
|
"assigned_to": userId,
|
||||||
"insurer_id": selectedInsurer,
|
"insurer_id": selectedInsurer,
|
||||||
"broker_id": selectedBroker,
|
"broker_id": selectedBroker,
|
||||||
"manager_id": managerId,
|
"manager_id": managerId,
|
||||||
@ -179,6 +185,7 @@ class CreateProposal_QuickFormState
|
|||||||
for (String field in tabHeader) {
|
for (String field in tabHeader) {
|
||||||
controllers[field] = TextEditingController();
|
controllers[field] = TextEditingController();
|
||||||
}
|
}
|
||||||
|
partnerFocusNode = FocusNode();
|
||||||
|
|
||||||
Future.microtask(() async {
|
Future.microtask(() async {
|
||||||
roleId = ref.read(userRoleProvider);
|
roleId = ref.read(userRoleProvider);
|
||||||
@ -212,6 +219,7 @@ class CreateProposal_QuickFormState
|
|||||||
// Dispose all TextEditingControllers
|
// Dispose all TextEditingControllers
|
||||||
for (var controller in controllers.values) {
|
for (var controller in controllers.values) {
|
||||||
controller.dispose();
|
controller.dispose();
|
||||||
|
partnerFocusNode.dispose();
|
||||||
}
|
}
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
@ -495,6 +503,10 @@ class CreateProposal_QuickFormState
|
|||||||
dropDownKeyInsurerEnqAsgn.currentState?.changeSelectedItem(null);
|
dropDownKeyInsurerEnqAsgn.currentState?.changeSelectedItem(null);
|
||||||
dropDownKey.currentState?.changeSelectedItem(null);
|
dropDownKey.currentState?.changeSelectedItem(null);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (isSingleSave) {
|
||||||
|
handleDone();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -533,6 +545,14 @@ class CreateProposal_QuickFormState
|
|||||||
dataDetails();
|
dataDetails();
|
||||||
final dataSet = dataDetails();
|
final dataSet = dataDetails();
|
||||||
print("dataSetAgent - $dataSet");
|
print("dataSetAgent - $dataSet");
|
||||||
|
|
||||||
|
if (quotationList.isEmpty) {
|
||||||
|
print("Please add at least one quotation before saving.");
|
||||||
|
// You can also show a snackbar or dialog
|
||||||
|
ToastHelper.showErrorToast(context, 'Add atleast one proposal');
|
||||||
|
return; // ❌ stop execution
|
||||||
|
}
|
||||||
|
|
||||||
// print("managerId - $managerId ,userId - $userId ");
|
// print("managerId - $managerId ,userId - $userId ");
|
||||||
createUserData(dataSet);
|
createUserData(dataSet);
|
||||||
} else {
|
} else {
|
||||||
@ -567,11 +587,23 @@ class CreateProposal_QuickFormState
|
|||||||
|
|
||||||
print("USerDAta - $userData");
|
print("USerDAta - $userData");
|
||||||
|
|
||||||
|
// userData.forEach((key, value) {
|
||||||
|
// // if (key != 'certificate_file_name') {
|
||||||
|
// request.fields[key] = value.toString();
|
||||||
|
// print("✅ Encoded $key: ${request.fields[key]}");
|
||||||
|
// // }
|
||||||
|
// });
|
||||||
|
|
||||||
userData.forEach((key, value) {
|
userData.forEach((key, value) {
|
||||||
// if (key != 'certificate_file_name') {
|
if (value is List || value is Map) {
|
||||||
request.fields[key] = value.toString();
|
// List, Map → convert to JSON
|
||||||
print("✅ Encoded $key: ${request.fields[key]}");
|
request.fields[key] = jsonEncode(value);
|
||||||
// }
|
} else {
|
||||||
|
// normal value
|
||||||
|
request.fields[key] = value?.toString() ?? "";
|
||||||
|
}
|
||||||
|
|
||||||
|
print("➡ $key: ${request.fields[key]}");
|
||||||
});
|
});
|
||||||
|
|
||||||
if (docUploadedFile != null) {
|
if (docUploadedFile != null) {
|
||||||
@ -612,7 +644,8 @@ class CreateProposal_QuickFormState
|
|||||||
print("Response: ${response.body}");
|
print("Response: ${response.body}");
|
||||||
// ToastHelper.showErrorToast(context, 'Proposal Created');
|
// ToastHelper.showErrorToast(context, 'Proposal Created');
|
||||||
reset();
|
reset();
|
||||||
Navigator.of(context).pop();
|
getQuickQuotationList(managerId);
|
||||||
|
// Navigator.of(context).pop();
|
||||||
} else if (response.statusCode == 403) {
|
} else if (response.statusCode == 403) {
|
||||||
await apiService.clearLocalStorageAndRedirect();
|
await apiService.clearLocalStorageAndRedirect();
|
||||||
} else {
|
} else {
|
||||||
@ -628,10 +661,70 @@ class CreateProposal_QuickFormState
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> handleProceed(val, id) async {
|
||||||
|
print('handleProceed -1 ');
|
||||||
|
final String apiUrldata;
|
||||||
|
apiUrldata = '${Env.apiUrl}quotation/acceptOrRejectQuotation';
|
||||||
|
|
||||||
|
// final token = await getToken(); // Fetch token
|
||||||
|
print('handleProceed -2 ');
|
||||||
|
if (_token == null) {
|
||||||
|
throw Exception('Token not found. Please log in.');
|
||||||
|
}
|
||||||
|
|
||||||
|
final Map<String, dynamic> data = {
|
||||||
|
"id": id,
|
||||||
|
// "status": 'Accepted',
|
||||||
|
"status": val,
|
||||||
|
"action_by": userId,
|
||||||
|
// "action_user": (role == 'agent') ? 'agent' : 'handler',
|
||||||
|
"action_user": roleId,
|
||||||
|
};
|
||||||
|
print('handleProceed -3 ');
|
||||||
|
// data['id'] = selectedId; // Add plan_id for update
|
||||||
|
// data['status'] = val;
|
||||||
|
|
||||||
|
print("data------- $data");
|
||||||
|
|
||||||
|
try {
|
||||||
|
final response = await http.post(
|
||||||
|
Uri.parse(apiUrldata),
|
||||||
|
headers: {
|
||||||
|
'Authorization': 'Bearer $_token',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'app-signature': Env.App_Signature,
|
||||||
|
},
|
||||||
|
body: jsonEncode(data), // Convert map to JSON
|
||||||
|
);
|
||||||
|
|
||||||
|
if (response.statusCode == 200) {
|
||||||
|
print("Response: ${response.body}");
|
||||||
|
|
||||||
|
ToastHelper.showSuccessToast(context, 'Status Updated');
|
||||||
|
print("tre1");
|
||||||
|
selectedId = null; // just update field
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
|
||||||
|
context.go('/enquiryForStaff');
|
||||||
|
print("tre11");
|
||||||
|
getQuickQuotationList(managerId);
|
||||||
|
} else if (response.statusCode == 403) {
|
||||||
|
await apiService.clearLocalStorageAndRedirect();
|
||||||
|
} else {
|
||||||
|
final responseBody = jsonDecode(response.body);
|
||||||
|
dynamic msg = responseBody['data'];
|
||||||
|
ToastHelper.showErrorToast(context, 'Status Updation Failed');
|
||||||
|
print("Failed to submit plan. Status: ${response.statusCode}");
|
||||||
|
print("Error: ${response.body}");
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
print(" Error submitting Staff: $e");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Form(
|
return FocusTraversalGroup(
|
||||||
key: _formKey,
|
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
@ -651,6 +744,8 @@ class CreateProposal_QuickFormState
|
|||||||
),
|
),
|
||||||
borderRadius: BorderRadius.circular(8.0),
|
borderRadius: BorderRadius.circular(8.0),
|
||||||
),
|
),
|
||||||
|
child: Form(
|
||||||
|
key: _formKey,
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
@ -661,6 +756,7 @@ class CreateProposal_QuickFormState
|
|||||||
buildVehicleNumber(context),
|
buildVehicleNumber(context),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
||||||
Divider(thickness: 0.3, color: Colors.blueGrey.shade100),
|
Divider(thickness: 0.3, color: Colors.blueGrey.shade100),
|
||||||
SizedBox(height: 2),
|
SizedBox(height: 2),
|
||||||
Row(
|
Row(
|
||||||
@ -674,14 +770,66 @@ class CreateProposal_QuickFormState
|
|||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
|
// SizedBox(width: 10),
|
||||||
|
// GestureDetector(
|
||||||
|
// onTap: () {
|
||||||
|
// setState(() {
|
||||||
|
// isSingleSave = true;
|
||||||
|
// });
|
||||||
|
// addQuotationRow();
|
||||||
|
// },
|
||||||
|
// child: Container(
|
||||||
|
// padding: const EdgeInsets.symmetric(
|
||||||
|
// horizontal: 5,
|
||||||
|
// vertical: 5,
|
||||||
|
// ),
|
||||||
|
// decoration: BoxDecoration(
|
||||||
|
// borderRadius: BorderRadius.circular(5.0),
|
||||||
|
// color: Colors.blue,
|
||||||
|
// ),
|
||||||
|
// child: Text(
|
||||||
|
// 'Save',
|
||||||
|
// style: GoogleFonts.poppins(
|
||||||
|
// color: Colors.white,
|
||||||
|
// fontSize: 10,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
ElevatedButton(
|
||||||
|
style: ElevatedButton.styleFrom(
|
||||||
|
backgroundColor: Colors.blue,
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 10,
|
||||||
|
vertical: 4,
|
||||||
|
),
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(5),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
setState(() {
|
||||||
|
isSingleSave = true;
|
||||||
|
});
|
||||||
|
addQuotationRow();
|
||||||
|
},
|
||||||
|
child: Text(
|
||||||
|
'Save',
|
||||||
|
style: GoogleFonts.poppins(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 10,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 10),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
addQuotationRow();
|
addQuotationRow();
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
horizontal: 2,
|
horizontal: 5,
|
||||||
vertical: 2,
|
vertical: 5,
|
||||||
),
|
),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(20.0),
|
borderRadius: BorderRadius.circular(20.0),
|
||||||
@ -703,7 +851,7 @@ class CreateProposal_QuickFormState
|
|||||||
const SizedBox(height: 10),
|
const SizedBox(height: 10),
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
'Added Proposal (${quotationList.length})',
|
'Added Quote(${quotationList.length})',
|
||||||
style: GoogleFonts.poppins(
|
style: GoogleFonts.poppins(
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
color: Color(0xFF334155),
|
color: Color(0xFF334155),
|
||||||
@ -813,26 +961,24 @@ class CreateProposal_QuickFormState
|
|||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
GestureDetector(
|
ElevatedButton(
|
||||||
onTap: () {
|
style: ElevatedButton.styleFrom(
|
||||||
handleDone();
|
backgroundColor: const Color(0xFF2E7D6E),
|
||||||
},
|
|
||||||
child: Container(
|
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
horizontal: 5,
|
horizontal: 18,
|
||||||
vertical: 5,
|
vertical: 12,
|
||||||
),
|
),
|
||||||
decoration: BoxDecoration(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(4.0),
|
borderRadius: BorderRadius.circular(6),
|
||||||
color: const Color(0xFF2E7D6E),
|
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
onPressed: handleDone,
|
||||||
child: Text(
|
child: Text(
|
||||||
'Save',
|
'Save All Quotes',
|
||||||
style: GoogleFonts.poppins(
|
style: GoogleFonts.poppins(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
fontSize: 12,
|
fontSize: 13,
|
||||||
fontWeight: FontWeight.w400,
|
fontWeight: FontWeight.w500,
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -841,6 +987,7 @@ class CreateProposal_QuickFormState
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
|
||||||
SizedBox(height: 10),
|
SizedBox(height: 10),
|
||||||
Container(
|
Container(
|
||||||
@ -864,14 +1011,61 @@ class CreateProposal_QuickFormState
|
|||||||
dividerThickness: 0.3,
|
dividerThickness: 0.3,
|
||||||
columnSpacing: 10,
|
columnSpacing: 10,
|
||||||
columns: [
|
columns: [
|
||||||
DataColumn(label: Text("Agent Name", style: _tableHeaderStyle)),
|
DataColumn(label: Text("Partner", style: _tableHeaderStyle)),
|
||||||
DataColumn(label: Text("Reg No", style: _tableHeaderStyle)),
|
DataColumn(
|
||||||
|
label: Text("Vehicle Number", style: _tableHeaderStyle),
|
||||||
|
),
|
||||||
DataColumn(label: Text("Insurer", style: _tableHeaderStyle)),
|
DataColumn(label: Text("Insurer", style: _tableHeaderStyle)),
|
||||||
|
DataColumn(label: Text("Plan Type", style: _tableHeaderStyle)),
|
||||||
DataColumn(label: Text("Premium", style: _tableHeaderStyle)),
|
DataColumn(label: Text("Premium", style: _tableHeaderStyle)),
|
||||||
DataColumn(label: Text("Action", style: _tableHeaderStyle)),
|
DataColumn(label: Text("Action", style: _tableHeaderStyle)),
|
||||||
],
|
],
|
||||||
|
rows: filteredCreatedProposalData.expand((item) {
|
||||||
|
List quotationList = item["quotation_data"] ?? [];
|
||||||
|
|
||||||
rows: filteredCreatedProposalData.map((item) {
|
if (quotationList.isEmpty) {
|
||||||
|
// If no quotation, show single empty row
|
||||||
|
return [
|
||||||
|
DataRow(
|
||||||
|
cells: [
|
||||||
|
DataCell(
|
||||||
|
Text(
|
||||||
|
item["agent_name"] ?? "-",
|
||||||
|
style: _tableDataStyle,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
DataCell(
|
||||||
|
Text(item["reg_no"] ?? "-", style: _tableDataStyle),
|
||||||
|
),
|
||||||
|
DataCell(Text("-", style: _tableDataStyle)),
|
||||||
|
DataCell(Text("-", style: _tableDataStyle)),
|
||||||
|
DataCell(Text("-", style: _tableDataStyle)),
|
||||||
|
DataCell(
|
||||||
|
ElevatedButton(
|
||||||
|
onPressed: () {
|
||||||
|
print('handleProceed - Accepted');
|
||||||
|
// Navigator.pop(context);
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
|
||||||
|
context.go('/enquiryForStaff');
|
||||||
|
// handleProceed('Accepted');
|
||||||
|
},
|
||||||
|
child: Text(
|
||||||
|
'PROCEED',
|
||||||
|
style: GoogleFonts.poppins(
|
||||||
|
fontSize: 10,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Multiple quotations — return multiple DataRow
|
||||||
|
return quotationList.map<DataRow>((quote) {
|
||||||
return DataRow(
|
return DataRow(
|
||||||
cells: [
|
cells: [
|
||||||
DataCell(
|
DataCell(
|
||||||
@ -882,19 +1076,28 @@ class CreateProposal_QuickFormState
|
|||||||
),
|
),
|
||||||
DataCell(
|
DataCell(
|
||||||
Text(
|
Text(
|
||||||
item["insurer_short_name"] ?? "-",
|
quote["insurer_short_name"] ?? "-",
|
||||||
style: _tableDataStyle,
|
style: _tableDataStyle,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
DataCell(
|
DataCell(
|
||||||
Text(
|
Text(
|
||||||
item["premium_amount"]?.toString() ?? "-",
|
quote["insurance_plan_type"] ?? "-",
|
||||||
style: _tableDataStyle,
|
style: _tableDataStyle,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
DataCell(
|
DataCell(
|
||||||
TextButton(
|
Text(
|
||||||
onPressed: () {},
|
"${quote["premium_amount"]}",
|
||||||
|
style: _tableDataStyle,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
DataCell(
|
||||||
|
ElevatedButton(
|
||||||
|
onPressed: () {
|
||||||
|
print('handleProceed - Accepted');
|
||||||
|
handleProceed('Accepted', quote['id']);
|
||||||
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
'PROCEED',
|
'PROCEED',
|
||||||
style: GoogleFonts.poppins(
|
style: GoogleFonts.poppins(
|
||||||
@ -906,6 +1109,7 @@ class CreateProposal_QuickFormState
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
}).toList();
|
||||||
}).toList(),
|
}).toList(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -1139,7 +1343,8 @@ class CreateProposal_QuickFormState
|
|||||||
highlightColor: Color(0xFF50A398),
|
highlightColor: Color(0xFF50A398),
|
||||||
padVertical: 10,
|
padVertical: 10,
|
||||||
isdense: true,
|
isdense: true,
|
||||||
|
errFieldHgt: 0.0,
|
||||||
|
errFieldFont: 0.0,
|
||||||
inputFormatters: [
|
inputFormatters: [
|
||||||
UpperCaseTextFormatter(), // 👈 custom formatter for uppercase
|
UpperCaseTextFormatter(), // 👈 custom formatter for uppercase
|
||||||
FilteringTextInputFormatter.allow(RegExp(r'[A-Za-z0-9- ]')),
|
FilteringTextInputFormatter.allow(RegExp(r'[A-Za-z0-9- ]')),
|
||||||
@ -1183,12 +1388,12 @@ class CreateProposal_QuickFormState
|
|||||||
itemAsString: (val) => val['short_name'].toString(), // what to show
|
itemAsString: (val) => val['short_name'].toString(), // what to show
|
||||||
compareFn: (item, selectedItem) =>
|
compareFn: (item, selectedItem) =>
|
||||||
item['id'] == selectedItem['id'], // ✅ compare by id
|
item['id'] == selectedItem['id'], // ✅ compare by id
|
||||||
validator: (val) {
|
// validator: (val) {
|
||||||
if (val == null) {
|
// if (val == null) {
|
||||||
return "Required"; // ✅ error message
|
// return "Required"; // ✅ error message
|
||||||
}
|
// }
|
||||||
return null;
|
// return null;
|
||||||
},
|
// },
|
||||||
suffixProps: DropdownSuffixProps(
|
suffixProps: DropdownSuffixProps(
|
||||||
// make sure the dropdown button is visible
|
// make sure the dropdown button is visible
|
||||||
dropdownButtonProps: DropdownButtonProps(
|
dropdownButtonProps: DropdownButtonProps(
|
||||||
@ -1330,8 +1535,8 @@ class CreateProposal_QuickFormState
|
|||||||
inputFormatters: [
|
inputFormatters: [
|
||||||
FilteringTextInputFormatter.allow(RegExp(r'[0-9.]')),
|
FilteringTextInputFormatter.allow(RegExp(r'[0-9.]')),
|
||||||
],
|
],
|
||||||
validator: (value) =>
|
// validator: (value) =>
|
||||||
Validators.doubleNumber(value, "PremiumAmount"),
|
// Validators.doubleNumber(value, "PremiumAmount"),
|
||||||
// validator: (value) => Validators.number(value, "PremiumAmount "),
|
// validator: (value) => Validators.number(value, "PremiumAmount "),
|
||||||
txtwidth: ResponsiveLayout.isMobile(context)
|
txtwidth: ResponsiveLayout.isMobile(context)
|
||||||
? null
|
? null
|
||||||
@ -1360,8 +1565,24 @@ class CreateProposal_QuickFormState
|
|||||||
? null
|
? null
|
||||||
: MediaQuery.of(context).size.width * 0.12,
|
: MediaQuery.of(context).size.width * 0.12,
|
||||||
height: 30,
|
height: 30,
|
||||||
|
child: FocusableActionDetector(
|
||||||
|
focusNode: partnerFocusNode,
|
||||||
|
autofocus: false,
|
||||||
|
onShowFocusHighlight: (hasFocus) {
|
||||||
|
setState(() {
|
||||||
|
focusedBorder:
|
||||||
|
OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
borderSide: const BorderSide(
|
||||||
|
color: Color(0xFF50A398),
|
||||||
|
width: 2,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}); // redraw to show highlight border
|
||||||
|
},
|
||||||
child: DropdownSearch<Map<String, dynamic>>(
|
child: DropdownSearch<Map<String, dynamic>>(
|
||||||
key: dropDownKey,
|
key: dropDownKey,
|
||||||
|
// focusNode: partnerFocusNode,
|
||||||
selectedItem: selectedVehicle.isNotEmpty ? selectedVehicle : null,
|
selectedItem: selectedVehicle.isNotEmpty ? selectedVehicle : null,
|
||||||
// items: (filter, infiniteScrollProps) {
|
// items: (filter, infiniteScrollProps) {
|
||||||
// return filteredInsuranceData;
|
// return filteredInsuranceData;
|
||||||
@ -1376,16 +1597,30 @@ class CreateProposal_QuickFormState
|
|||||||
);
|
);
|
||||||
}).toList();
|
}).toList();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
suffixProps: DropdownSuffixProps(
|
||||||
|
// make sure the dropdown button is visible
|
||||||
|
dropdownButtonProps: DropdownButtonProps(
|
||||||
|
isVisible: true,
|
||||||
|
padding: EdgeInsets.zero, // remove default padding
|
||||||
|
constraints: const BoxConstraints(
|
||||||
|
// shrink icon tap area
|
||||||
|
minWidth: 12,
|
||||||
|
minHeight: 12,
|
||||||
|
),
|
||||||
|
iconSize: 15, // smaller icon
|
||||||
|
// icon: const Icon(Icons.arrow_drop_down),
|
||||||
|
),
|
||||||
|
),
|
||||||
itemAsString: (val) => val['insurance_plan_type'].toString(),
|
itemAsString: (val) => val['insurance_plan_type'].toString(),
|
||||||
compareFn: (item, selectedItem) =>
|
compareFn: (item, selectedItem) =>
|
||||||
item['id'] == selectedItem['id'], // ✅ compare by id
|
item['id'] == selectedItem['id'], // ✅ compare by id
|
||||||
validator: (val) {
|
// validator: (val) {
|
||||||
if (val == null) {
|
// if (val == null) {
|
||||||
return "Required"; // ✅ error message
|
// return "Required"; // ✅ error message
|
||||||
}
|
// }
|
||||||
return null;
|
// return null;
|
||||||
},
|
// },
|
||||||
|
|
||||||
decoratorProps: DropDownDecoratorProps(
|
decoratorProps: DropDownDecoratorProps(
|
||||||
decoration:
|
decoration:
|
||||||
AppInputDecorations.dropdownDecoration(
|
AppInputDecorations.dropdownDecoration(
|
||||||
@ -1458,7 +1693,10 @@ class CreateProposal_QuickFormState
|
|||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
item['insurance_plan_type'].toString(),
|
item['insurance_plan_type'].toString(),
|
||||||
style: GoogleFonts.inter(fontSize: 12, color: Colors.black),
|
style: GoogleFonts.inter(
|
||||||
|
fontSize: 12,
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@ -1494,6 +1732,7 @@ class CreateProposal_QuickFormState
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
4696
lib/presentation/screens/staff/Enquiry/enquiry_inline_dec1.dart
Normal file
4696
lib/presentation/screens/staff/Enquiry/enquiry_inline_dec1.dart
Normal file
File diff suppressed because it is too large
Load Diff
@ -13,6 +13,7 @@ import 'package:intl/intl.dart';
|
|||||||
import 'package:nhance_partner/presentation/screens/dashboard/dashboard.dart';
|
import 'package:nhance_partner/presentation/screens/dashboard/dashboard.dart';
|
||||||
import 'package:nhance_partner/presentation/screens/staff/Enquiry/quotationPopUpAccptReject.dart';
|
import 'package:nhance_partner/presentation/screens/staff/Enquiry/quotationPopUpAccptReject.dart';
|
||||||
import 'package:nhance_partner/presentation/screens/staff/Enquiry/raise_enq_form.dart';
|
import 'package:nhance_partner/presentation/screens/staff/Enquiry/raise_enq_form.dart';
|
||||||
|
import 'package:nhance_partner/presentation/screens/staff/Enquiry/staff_policy.dart';
|
||||||
import 'package:nhance_partner/presentation/screens/staff/Enquiry/tabs/tab.dart';
|
import 'package:nhance_partner/presentation/screens/staff/Enquiry/tabs/tab.dart';
|
||||||
import 'package:nhance_partner/presentation/themes/indicators/customizd_multi_file_upload.dart';
|
import 'package:nhance_partner/presentation/themes/indicators/customizd_multi_file_upload.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
@ -134,6 +135,10 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
|
|
||||||
String? selectedId;
|
String? selectedId;
|
||||||
|
|
||||||
|
int selectedIndex = 0;
|
||||||
|
|
||||||
|
final List<String> enquiryTabs = ["In Progress", "Completed"];
|
||||||
|
|
||||||
Map<String, dynamic> dataDetails() {
|
Map<String, dynamic> dataDetails() {
|
||||||
final data = {
|
final data = {
|
||||||
"agent_id":
|
"agent_id":
|
||||||
@ -211,7 +216,7 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
super.initState();
|
super.initState();
|
||||||
|
|
||||||
apiService = ApiService();
|
apiService = ApiService();
|
||||||
timer = Timer.periodic(Duration(seconds: 3), (Timer t) => callRefresh());
|
timer = Timer.periodic(Duration(seconds: 10), (Timer t) => callRefresh());
|
||||||
for (String field in tabHeader) {
|
for (String field in tabHeader) {
|
||||||
controllers[field] = TextEditingController();
|
controllers[field] = TextEditingController();
|
||||||
}
|
}
|
||||||
@ -2420,77 +2425,77 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
buildPhNumber(context),
|
buildPhNumber(context),
|
||||||
buildRemarks(context),
|
buildRemarks(context),
|
||||||
|
|
||||||
Padding(
|
// Padding(
|
||||||
padding: const EdgeInsets.only(top: 8.0),
|
// padding: const EdgeInsets.only(top: 8.0),
|
||||||
child: Builder(
|
// child: Builder(
|
||||||
builder: (buttonContext) => Material(
|
// builder: (buttonContext) => Material(
|
||||||
// color: Color(0xFFFFFCF2),
|
// // color: Color(0xFFFFFCF2),
|
||||||
color: Color(0xFFF8F9FF),
|
// color: Color(0xFFF8F9FF),
|
||||||
child: InkWell(
|
// child: InkWell(
|
||||||
hoverColor: Color(0xFFF8F9FF),
|
// hoverColor: Color(0xFFF8F9FF),
|
||||||
// hoverColor: const Color(0xFFFFFCF2),
|
// // hoverColor: const Color(0xFFFFFCF2),
|
||||||
// hoverColor: const Color(0xFFEAF6F4),
|
// // hoverColor: const Color(0xFFEAF6F4),
|
||||||
onTap: () async {
|
// onTap: () async {
|
||||||
// ✅ Get overlay and button position RELATIVE to InkWell
|
// // ✅ Get overlay and button position RELATIVE to InkWell
|
||||||
final RenderBox button =
|
// final RenderBox button =
|
||||||
buttonContext.findRenderObject() as RenderBox;
|
// buttonContext.findRenderObject() as RenderBox;
|
||||||
final RenderBox overlay =
|
// final RenderBox overlay =
|
||||||
Overlay.of(buttonContext).context.findRenderObject()
|
// Overlay.of(buttonContext).context.findRenderObject()
|
||||||
as RenderBox;
|
// as RenderBox;
|
||||||
|
//
|
||||||
final Offset position = button.localToGlobal(
|
// final Offset position = button.localToGlobal(
|
||||||
Offset.zero,
|
// Offset.zero,
|
||||||
ancestor: overlay,
|
// ancestor: overlay,
|
||||||
);
|
// );
|
||||||
|
//
|
||||||
await showMenu(
|
// await showMenu(
|
||||||
context: buttonContext,
|
// context: buttonContext,
|
||||||
position: RelativeRect.fromLTRB(
|
// position: RelativeRect.fromLTRB(
|
||||||
position.dx,
|
// position.dx,
|
||||||
position.dy + button.size.height,
|
// position.dy + button.size.height,
|
||||||
overlay.size.width,
|
// overlay.size.width,
|
||||||
0,
|
// 0,
|
||||||
),
|
// ),
|
||||||
items: [
|
// items: [
|
||||||
PopupMenuItem(
|
// PopupMenuItem(
|
||||||
child: Column(
|
// child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
// mainAxisSize: MainAxisSize.min,
|
||||||
children: _buildPopupDownload(
|
// children: _buildPopupDownload(
|
||||||
buttonContext,
|
// buttonContext,
|
||||||
selectId,
|
// selectId,
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
],
|
// ],
|
||||||
|
// // color: Colors.white,
|
||||||
|
// // color: Color(0xFFFFFCF2),
|
||||||
|
// color: Color(0xFFF8F9FF),
|
||||||
|
// );
|
||||||
|
// },
|
||||||
|
// child: Tooltip(
|
||||||
|
// message: 'Click To Upload Documents',
|
||||||
|
//
|
||||||
|
// waitDuration: const Duration(milliseconds: 500),
|
||||||
|
// showDuration: const Duration(seconds: 2),
|
||||||
|
// child: Container(
|
||||||
|
// padding: EdgeInsets.all(8.0),
|
||||||
|
// decoration: BoxDecoration(
|
||||||
// color: Colors.white,
|
// color: Colors.white,
|
||||||
// color: Color(0xFFFFFCF2),
|
// borderRadius: BorderRadius.circular(50),
|
||||||
color: Color(0xFFF8F9FF),
|
// ),
|
||||||
);
|
// child: Icon(
|
||||||
},
|
// Icons.upload_file,
|
||||||
child: Tooltip(
|
// color: Color(0XFF6366F1),
|
||||||
message: 'Click To Upload Documents',
|
// // editing ? Icons.upload_file : Icons.download_for_offline,
|
||||||
|
// // color: editing ? Colors.b lue : Colors.green,
|
||||||
waitDuration: const Duration(milliseconds: 500),
|
// size: 20,
|
||||||
showDuration: const Duration(seconds: 2),
|
// ),
|
||||||
child: Container(
|
// ),
|
||||||
padding: EdgeInsets.all(8.0),
|
// ),
|
||||||
decoration: BoxDecoration(
|
// ),
|
||||||
color: Colors.white,
|
// ),
|
||||||
borderRadius: BorderRadius.circular(50),
|
// ),
|
||||||
),
|
// ),
|
||||||
child: Icon(
|
|
||||||
Icons.upload_file,
|
|
||||||
color: Color(0XFF6366F1),
|
|
||||||
// editing ? Icons.upload_file : Icons.download_for_offline,
|
|
||||||
// color: editing ? Colors.b lue : Colors.green,
|
|
||||||
size: 20,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(top: 8.0),
|
padding: const EdgeInsets.only(top: 8.0),
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
@ -2863,12 +2868,15 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
// ],
|
// ],
|
||||||
// ),
|
// ),
|
||||||
width: MediaQuery.of(context).size.width,
|
width: MediaQuery.of(context).size.width,
|
||||||
|
// height: MediaQuery.of(context).size.height * 0.1,
|
||||||
// padding: EdgeInsets.all(12.0),
|
// padding: EdgeInsets.all(12.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
RaiseEnqForm(
|
Container(
|
||||||
|
// height: MediaQuery.of(context).size.height*0.
|
||||||
|
child: RaiseEnqForm(
|
||||||
key: raiseEnqKey,
|
key: raiseEnqKey,
|
||||||
onSubmit: (dataSet) async {
|
onSubmit: (dataSet) async {
|
||||||
print('Check checking dataSet $dataSet');
|
print('Check checking dataSet $dataSet');
|
||||||
@ -2894,6 +2902,7 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
|
||||||
// SizedBox(height: 5),
|
// SizedBox(height: 5),
|
||||||
ResponsiveLayout.isMobile(context)
|
ResponsiveLayout.isMobile(context)
|
||||||
@ -2920,29 +2929,29 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
),
|
),
|
||||||
|
|
||||||
// ),
|
// ),
|
||||||
Container(
|
// Container(
|
||||||
// height: 20,
|
// // height: 20,
|
||||||
width: MediaQuery.of(context).size.width,
|
// width: MediaQuery.of(context).size.width,
|
||||||
// color: Colors.green.shade50,
|
// // color: Colors.green.shade50,
|
||||||
child: PaginationControls(
|
// child: PaginationControls(
|
||||||
currentPage: currentPage,
|
// currentPage: currentPage,
|
||||||
itemsPerPage: itemsPerPage,
|
// itemsPerPage: itemsPerPage,
|
||||||
// totalItems: dataVal.length,
|
// // totalItems: dataVal.length,
|
||||||
totalItems: filteredData.length,
|
// totalItems: filteredData.length,
|
||||||
// activeColor: layoutColor, // your theme color
|
// // activeColor: layoutColor, // your theme color
|
||||||
onPageChanged: (page) {
|
// onPageChanged: (page) {
|
||||||
setState(() {
|
// setState(() {
|
||||||
currentPage = page;
|
// currentPage = page;
|
||||||
});
|
// });
|
||||||
},
|
// },
|
||||||
onItemsPerPageChanged: (items) {
|
// onItemsPerPageChanged: (items) {
|
||||||
setState(() {
|
// setState(() {
|
||||||
itemsPerPage = items;
|
// itemsPerPage = items;
|
||||||
currentPage = 1;
|
// currentPage = 1;
|
||||||
});
|
// });
|
||||||
},
|
// },
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -2971,6 +2980,37 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
refrshfilterDateRange();
|
refrshfilterDateRange();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> buildPolicyCreatedStatusActions(
|
||||||
|
BuildContext context,
|
||||||
|
status,
|
||||||
|
id,
|
||||||
|
) async {
|
||||||
|
print("Actionsstatus - $status -$id");
|
||||||
|
dynamic val;
|
||||||
|
if (status == 'Awaiting Proposal' || status == 'Proposal Created') {
|
||||||
|
val = '';
|
||||||
|
} else {
|
||||||
|
val = 'Policy';
|
||||||
|
}
|
||||||
|
|
||||||
|
final result = await showDialog(
|
||||||
|
context: context,
|
||||||
|
barrierDismissible:
|
||||||
|
false, // optional - prevents closing by tapping outside
|
||||||
|
builder: (context) => PolicyStaffEnqList(),
|
||||||
|
);
|
||||||
|
|
||||||
|
// ✅ Code here runs *after* the dialog is closed
|
||||||
|
print("Dialog closed");
|
||||||
|
print("Dialog result: $result");
|
||||||
|
if (result) {
|
||||||
|
setState(() {
|
||||||
|
isActionable = false;
|
||||||
|
});
|
||||||
|
refrshfilterDateRange();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Widget _buildContent(BuildContext context) {
|
Widget _buildContent(BuildContext context) {
|
||||||
final isDesktop = !ResponsiveLayout.isMobile(context);
|
final isDesktop = !ResponsiveLayout.isMobile(context);
|
||||||
return Column(
|
return Column(
|
||||||
@ -3076,8 +3116,8 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
SizedBox(height: 5),
|
// SizedBox(height: 5),
|
||||||
|
SizedBox(child: _buildStyledTabs()),
|
||||||
ResponsiveLayout.isMobile(context)
|
ResponsiveLayout.isMobile(context)
|
||||||
? _buildDataTable(context)
|
? _buildDataTable(context)
|
||||||
:
|
:
|
||||||
@ -3095,59 +3135,135 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
|
|
||||||
// 1. Add group expansion state tracking
|
// 1. Add group expansion state tracking
|
||||||
Map<String, bool> groupExpanded = {
|
Map<String, bool> groupExpanded = {
|
||||||
'Awaiting Proposal': true,
|
// 'Awaiting Proposal': true,
|
||||||
'Proposal Created': true,
|
// 'Proposal Created': true,
|
||||||
// 'Proposal Accepted': true,
|
// 'Proposal Accepted': true,
|
||||||
// 'Proposal Rejected': true,
|
// 'Proposal Rejected': true,
|
||||||
'Policy Created': true,
|
// 'Awaiting Payment': true,
|
||||||
|
// 'Policy Created': true,
|
||||||
|
'To be assigned': true,
|
||||||
|
'Assigned': true,
|
||||||
|
'In progress': true,
|
||||||
};
|
};
|
||||||
|
|
||||||
Map<String, String> statusGroupMap = {
|
Map<String, String> statusGroupMap = {
|
||||||
'Awaiting Proposal': 'Awaiting Proposal',
|
// 'Awaiting Proposal': 'Awaiting Proposal',
|
||||||
'Proposal Created': 'Proposal Created',
|
// 'Proposal Created': 'Proposal Created',
|
||||||
'Proposal Accepted': 'Proposal Created',
|
// 'Proposal Accepted': 'Proposal Created',
|
||||||
'Proposal Rejected': 'Proposal Created',
|
// 'Proposal Rejected': 'Proposal Created',
|
||||||
'Policy Created': 'Policy Created',
|
// 'Proposal Created': 'Awaiting Payment',
|
||||||
|
// 'Proposal Accepted': 'Awaiting Payment',
|
||||||
|
// 'Proposal Rejected': 'Awaiting Payment',
|
||||||
|
// 'Policy Created': 'Policy Created',
|
||||||
|
// 'Policy Created': 'Policy Created',
|
||||||
|
'To be assigned': 'To be assigned',
|
||||||
|
'Assigned': 'Assigned',
|
||||||
|
'In progress': 'In progress',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
List<Map<String, dynamic>> get filteredDataByTab {
|
||||||
|
if (selectedIndex == 0) {
|
||||||
|
// Progress enquiries
|
||||||
|
final sortedData = [...filteredData]
|
||||||
|
..sort((a, b) => int.parse(b['id']) - int.parse(a['id']));
|
||||||
|
|
||||||
|
if (sortedData.isEmpty) return [];
|
||||||
|
return sortedData.where((e) {
|
||||||
|
return [
|
||||||
|
"To be assigned",
|
||||||
|
"Assigned",
|
||||||
|
"In progress",
|
||||||
|
].contains(e['enquiry_status']);
|
||||||
|
}).toList();
|
||||||
|
} else {
|
||||||
|
final sortedData = [...filteredData]
|
||||||
|
..sort((a, b) => int.parse(b['id']) - int.parse(a['id']));
|
||||||
|
|
||||||
|
if (sortedData.isEmpty) return [];
|
||||||
|
// Completed enquiries
|
||||||
|
return sortedData.where((e) {
|
||||||
|
return e['enquiry_status'] == "Completed";
|
||||||
|
}).toList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Add group enquiries by status
|
// Add group enquiries by status
|
||||||
Map<String, List<Map<String, dynamic>>> get _groupedEnquiries {
|
Map<String, List<Map<String, dynamic>>> get _groupedEnquiries {
|
||||||
final grouped = <String, List<Map<String, dynamic>>>{};
|
final Map<String, List<Map<String, dynamic>>> grouped = {};
|
||||||
|
|
||||||
// Initialize all status groups
|
if (selectedIndex == 0) {
|
||||||
grouped['Awaiting Proposal'] = [];
|
grouped["To be assigned"] = [];
|
||||||
grouped['Proposal Created'] = [];
|
grouped["Assigned"] = [];
|
||||||
grouped['Proposal Accepted'] = [];
|
grouped["In progress"] = [];
|
||||||
grouped['Proposal Rejected'] = [];
|
} else {
|
||||||
grouped['Policy Created'] = [];
|
grouped["Completed"] = [];
|
||||||
|
}
|
||||||
|
|
||||||
// Initialize only the groups you need
|
for (var item in filteredDataByTab) {
|
||||||
grouped['Awaiting Proposal'] = [];
|
final status = (item['enquiry_status'] ?? '').toString();
|
||||||
grouped['Proposal Created'] = [];
|
if (grouped.containsKey(status)) {
|
||||||
grouped['Policy Created'] = [];
|
grouped[status]!.add(item);
|
||||||
|
|
||||||
// Group the filtered/paginated data by status
|
|
||||||
// for (var item in _paginatedData) {
|
|
||||||
// final status = item['status']?.toString() ?? 'Unknown';
|
|
||||||
// if (grouped.containsKey(status)) {
|
|
||||||
// grouped[status]!.add(item);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
for (var item in _paginatedData) {
|
|
||||||
final status = item['status']?.toString() ?? 'Unknown';
|
|
||||||
|
|
||||||
// Map actual status to grouped status
|
|
||||||
final groupKey = statusGroupMap[status];
|
|
||||||
|
|
||||||
if (groupKey != null) {
|
|
||||||
grouped[groupKey]!.add(item);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return grouped;
|
return grouped;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Map<String, List<Map<String, dynamic>>> get _groupedEnquiries {
|
||||||
|
// final grouped = <String, List<Map<String, dynamic>>>{};
|
||||||
|
//
|
||||||
|
// // Initialize all status groups
|
||||||
|
// // grouped['Awaiting Proposal'] = [];
|
||||||
|
// // grouped['Proposal Created'] = [];
|
||||||
|
// // grouped['Proposal Accepted'] = [];
|
||||||
|
// // grouped['Proposal Rejected'] = [];
|
||||||
|
// // grouped['Policy Created'] = [];
|
||||||
|
// // grouped['Awaiting Payment'] = [];
|
||||||
|
//
|
||||||
|
// // Initialize only the groups you need
|
||||||
|
// // grouped['Awaiting Proposal'] = [];
|
||||||
|
// // grouped['Proposal Created'] = [];
|
||||||
|
// // grouped['Policy Created'] = [];
|
||||||
|
//
|
||||||
|
// grouped['To be assigned'] = [];
|
||||||
|
// grouped['Assigned'] = [];
|
||||||
|
// grouped['In progress'] = [];
|
||||||
|
//
|
||||||
|
// // Group the filtered/paginated data by status
|
||||||
|
// // for (var item in _paginatedData) {
|
||||||
|
// // final status = item['status']?.toString() ?? 'Unknown';
|
||||||
|
// // if (grouped.containsKey(status)) {
|
||||||
|
// // grouped[status]!.add(item);
|
||||||
|
// // }
|
||||||
|
// // }
|
||||||
|
//
|
||||||
|
// for (var item in filteredData) {
|
||||||
|
// // final status = item['status']?.toString() ?? 'Unknown';
|
||||||
|
// final status = item['enquiry_status']?.toString() ?? 'Unknown';
|
||||||
|
//
|
||||||
|
// // Map actual status to grouped status
|
||||||
|
// final groupKey = statusGroupMap[status];
|
||||||
|
//
|
||||||
|
// if (groupKey != null) {
|
||||||
|
// grouped[groupKey]!.add(item);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// // for (var item in _paginatedData) {
|
||||||
|
// // // final status = item['status']?.toString() ?? 'Unknown';
|
||||||
|
// // final status = item['enquiry_status']?.toString() ?? 'Unknown';
|
||||||
|
// //
|
||||||
|
// // // Map actual status to grouped status
|
||||||
|
// // final groupKey = statusGroupMap[status];
|
||||||
|
// //
|
||||||
|
// // if (groupKey != null) {
|
||||||
|
// // grouped[groupKey]!.add(item);
|
||||||
|
// // }
|
||||||
|
// // }
|
||||||
|
//
|
||||||
|
// return grouped;
|
||||||
|
// }
|
||||||
|
|
||||||
Map<String, dynamic> _getStatusConfig(String status) {
|
Map<String, dynamic> _getStatusConfig(String status) {
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case 'Awaiting Proposal':
|
case 'Awaiting Proposal':
|
||||||
@ -3170,7 +3286,12 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
'Proposal Created': const Color(0xFFF0F9FF), // Cyan 50
|
'Proposal Created': const Color(0xFFF0F9FF), // Cyan 50
|
||||||
'Proposal Accepted': const Color(0xFFF0FDF4), // Green 50
|
'Proposal Accepted': const Color(0xFFF0FDF4), // Green 50
|
||||||
'Proposal Rejected': const Color(0xFFFEF9C3), // Yellow 50
|
'Proposal Rejected': const Color(0xFFFEF9C3), // Yellow 50
|
||||||
'Policy Created': const Color(0xFFF3F0FF), // Purple 50 (generated)
|
'Policy Created': const Color(0xFFF3F0FF),
|
||||||
|
|
||||||
|
'To be assigned': const Color(0xFFEFF6FF), // Blue 50
|
||||||
|
'Assigned': const Color(0xFFFEF9C3), // Cyan 50
|
||||||
|
'In progress': const Color(0xFFF0FDF4), // Green 50
|
||||||
|
'Completed': const Color(0xFFF3F0FF), // Purple 50 (generated)
|
||||||
};
|
};
|
||||||
|
|
||||||
final Map<String, Color> statusBorderColors = {
|
final Map<String, Color> statusBorderColors = {
|
||||||
@ -3179,6 +3300,11 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
'Proposal Accepted': const Color(0xFFDCFCE7), // Green 100
|
'Proposal Accepted': const Color(0xFFDCFCE7), // Green 100
|
||||||
'Proposal Rejected': const Color(0xFFFEF3C7), // Yellow 100
|
'Proposal Rejected': const Color(0xFFFEF3C7), // Yellow 100
|
||||||
'Policy Created': const Color(0xFFF0E4FF), // Purple 200
|
'Policy Created': const Color(0xFFF0E4FF), // Purple 200
|
||||||
|
|
||||||
|
'To be assigned': const Color(0xFFDBEAFE), // Blue 100
|
||||||
|
'Assigned': const Color(0xFFFEF3C7), // Cyan 100
|
||||||
|
'In progress': const Color(0xFFDCFCE7), // Green 100
|
||||||
|
'Completed': const Color(0xFFF0E4FF), // Purple 200
|
||||||
// 'Policy Created': const Color(0xFFE5CCFF), // Purple 200
|
// 'Policy Created': const Color(0xFFE5CCFF), // Purple 200
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -3202,7 +3328,7 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 4),
|
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 2),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Icon(
|
Icon(
|
||||||
@ -3348,6 +3474,8 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
// Group Header
|
// Group Header
|
||||||
|
// if (status != 'Proposal Accepted' &&
|
||||||
|
// status != 'Proposal Rejected') ...[
|
||||||
if (status != 'Proposal Accepted' &&
|
if (status != 'Proposal Accepted' &&
|
||||||
status != 'Proposal Rejected') ...[
|
status != 'Proposal Rejected') ...[
|
||||||
Container(
|
Container(
|
||||||
@ -3487,7 +3615,8 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
final editing = isEditingRow[id] ?? false;
|
final editing = isEditingRow[id] ?? false;
|
||||||
final controllers = rowControllers[id];
|
final controllers = rowControllers[id];
|
||||||
|
|
||||||
String status = item['status'] ?? '-';
|
// String status = item['status'] ?? '-';
|
||||||
|
String status = item['enquiry_status'] ?? '-';
|
||||||
|
|
||||||
Color bgColor = statusColors[status] ?? Color(0xFFF9FAFB);
|
Color bgColor = statusColors[status] ?? Color(0xFFF9FAFB);
|
||||||
Color borderColor = statusBorderColors[status] ?? Color(0xFFE2E8F0);
|
Color borderColor = statusBorderColors[status] ?? Color(0xFFE2E8F0);
|
||||||
@ -3774,6 +3903,91 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
|
DataCell(
|
||||||
|
SizedBox(
|
||||||
|
width: 120,
|
||||||
|
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
if (item['enquiry_status'] != 'Assigned') ...[
|
||||||
|
Material(
|
||||||
|
color: Colors.white,
|
||||||
|
child: InkWell(
|
||||||
|
// hoverColor: Color(0xFFEAF6F4),
|
||||||
|
onTap: null,
|
||||||
|
// onTap: () async {
|
||||||
|
// setState(() {
|
||||||
|
// isActionable = true;
|
||||||
|
// });
|
||||||
|
// buildPolicyCreatedStatusActions(
|
||||||
|
// context,
|
||||||
|
// item['status'],
|
||||||
|
// item['id'],
|
||||||
|
// );
|
||||||
|
// },
|
||||||
|
child: Tooltip(
|
||||||
|
message: 'Click to View or Process Enquiry', //
|
||||||
|
waitDuration: const Duration(
|
||||||
|
milliseconds: 500,
|
||||||
|
), // optional
|
||||||
|
showDuration: const Duration(seconds: 2), // optional
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 2.0),
|
||||||
|
margin: EdgeInsets.symmetric(vertical: 2),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
// color: Color(0xFFF9FAFB),
|
||||||
|
// border: Border.all(color: Color(0xFFE2E8F0)),
|
||||||
|
color: bgColor,
|
||||||
|
border: Border.all(color: borderColor),
|
||||||
|
borderRadius: BorderRadius.circular(5),
|
||||||
|
),
|
||||||
|
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
item['enquiry_status'] ?? '-',
|
||||||
|
// item['status'] ?? '-',
|
||||||
|
style: GoogleFonts.inter(
|
||||||
|
fontSize: 10,
|
||||||
|
color: Color(0XFF1e293b),
|
||||||
|
// color: statusTextColors[status] ?? Colors.black,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
// overflow: TextOverflow.clip, //
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// child: Text(item['status'] ?? '-', style: _dataBold),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
if (item['enquiry_status'] == 'Assigned') ...[
|
||||||
|
TextButton(
|
||||||
|
onPressed: () async {
|
||||||
|
final res = await apiService.updateEnquiryInProgress(id);
|
||||||
|
if (res['status'] == 'success') {
|
||||||
|
refrshfilterDateRange();
|
||||||
|
}
|
||||||
|
print('updateEnquiryInProgress - $res');
|
||||||
|
},
|
||||||
|
child: Text(
|
||||||
|
'PROCEED',
|
||||||
|
style: GoogleFonts.poppins(
|
||||||
|
fontSize: 11,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: Colors.green,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
// Assigned Date (formatted)
|
// Assigned Date (formatted)
|
||||||
// DataCell(
|
// DataCell(
|
||||||
// SizedBox(
|
// SizedBox(
|
||||||
@ -4285,65 +4499,65 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
DataCell(
|
// DataCell(
|
||||||
SizedBox(
|
// SizedBox(
|
||||||
width: 120,
|
// width: 120,
|
||||||
|
//
|
||||||
child: Material(
|
// child: Material(
|
||||||
color: Colors.white,
|
// color: Colors.white,
|
||||||
child: InkWell(
|
// child: InkWell(
|
||||||
// hoverColor: Color(0xFFEAF6F4),
|
// // hoverColor: Color(0xFFEAF6F4),
|
||||||
onTap: () async {
|
// onTap: () async {
|
||||||
var status = item['status'];
|
// var status = item['status'];
|
||||||
var enqId = item['id'];
|
// var enqId = item['id'];
|
||||||
|
//
|
||||||
final prefs = await SharedPreferences.getInstance();
|
// final prefs = await SharedPreferences.getInstance();
|
||||||
|
//
|
||||||
// ✅ Remove old value (if any)
|
// // ✅ Remove old value (if any)
|
||||||
await prefs.remove('enqStaffDataId');
|
// await prefs.remove('enqStaffDataId');
|
||||||
|
//
|
||||||
// ✅ Save the new id
|
// // ✅ Save the new id
|
||||||
await prefs.setString('enqStaffDataId', enqId.toString());
|
// await prefs.setString('enqStaffDataId', enqId.toString());
|
||||||
ref.read(quotationStaffIdProvider.notifier).state = enqId;
|
// ref.read(quotationStaffIdProvider.notifier).state = enqId;
|
||||||
buildStatusActions(context, status, enqId);
|
// buildStatusActions(context, status, enqId);
|
||||||
},
|
// },
|
||||||
child: Tooltip(
|
// child: Tooltip(
|
||||||
message: 'Click to View or Process Enquiry', //
|
// message: 'Click to View or Process Enquiry', //
|
||||||
waitDuration: const Duration(milliseconds: 500), // optional
|
// waitDuration: const Duration(milliseconds: 500), // optional
|
||||||
showDuration: const Duration(seconds: 2), // optional
|
// showDuration: const Duration(seconds: 2), // optional
|
||||||
child: Container(
|
// child: Container(
|
||||||
padding: EdgeInsets.symmetric(vertical: 2.0),
|
// padding: EdgeInsets.symmetric(vertical: 2.0),
|
||||||
margin: EdgeInsets.symmetric(vertical: 2),
|
// margin: EdgeInsets.symmetric(vertical: 2),
|
||||||
decoration: BoxDecoration(
|
// decoration: BoxDecoration(
|
||||||
// color: Color(0xFFF9FAFB),
|
// // color: Color(0xFFF9FAFB),
|
||||||
// border: Border.all(color: Color(0xFFE2E8F0)),
|
// // border: Border.all(color: Color(0xFFE2E8F0)),
|
||||||
color: bgColor,
|
// color: bgColor,
|
||||||
border: Border.all(color: borderColor),
|
// border: Border.all(color: borderColor),
|
||||||
borderRadius: BorderRadius.circular(5),
|
// borderRadius: BorderRadius.circular(5),
|
||||||
),
|
// ),
|
||||||
|
//
|
||||||
child: Row(
|
// child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
// mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
// children: [
|
||||||
Text(
|
// Text(
|
||||||
item['status'] ?? '-',
|
// item['status'] ?? '-',
|
||||||
style: GoogleFonts.inter(
|
// style: GoogleFonts.inter(
|
||||||
fontSize: 10,
|
// fontSize: 10,
|
||||||
color: Color(0XFF1e293b),
|
// color: Color(0XFF1e293b),
|
||||||
// color: statusTextColors[status] ?? Colors.black,
|
// // color: statusTextColors[status] ?? Colors.black,
|
||||||
fontWeight: FontWeight.w500,
|
// fontWeight: FontWeight.w500,
|
||||||
),
|
// ),
|
||||||
// overflow: TextOverflow.clip, //
|
// // overflow: TextOverflow.clip, //
|
||||||
),
|
// ),
|
||||||
],
|
// ],
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
// child: Text(item['status'] ?? '-', style: _dataBold),
|
// // child: Text(item['status'] ?? '-', style: _dataBold),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -4360,12 +4574,12 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
DataColumn(label: Text('Insured Name *', style: _headerStyle)),
|
DataColumn(label: Text('Insured Name *', style: _headerStyle)),
|
||||||
DataColumn(label: Text('Vehicle No *', style: _headerStyle)),
|
DataColumn(label: Text('Vehicle No *', style: _headerStyle)),
|
||||||
DataColumn(label: Text('Action', style: _headerStyle)),
|
DataColumn(label: Text('Action', style: _headerStyle)),
|
||||||
|
DataColumn(label: Text('Status', style: _headerStyle)),
|
||||||
// const DataColumn(label: Text('Assigned Date', style: _headerStyle)),
|
// const DataColumn(label: Text('Assigned Date', style: _headerStyle)),
|
||||||
// DataColumn(label: Text('Premium', style: _headerStyle)),
|
// DataColumn(label: Text('Premium', style: _headerStyle)),
|
||||||
DataColumn(label: Text('Payment Mode', style: _headerStyle)),
|
DataColumn(label: Text('Payment Mode', style: _headerStyle)),
|
||||||
DataColumn(label: Text('Plan Type', style: _headerStyle)),
|
DataColumn(label: Text('Plan Type', style: _headerStyle)),
|
||||||
DataColumn(label: Text('Policy Number', style: _headerStyle)),
|
DataColumn(label: Text('Policy', style: _headerStyle)),
|
||||||
DataColumn(label: Text('Status', style: _headerStyle)),
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4383,14 +4597,14 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
_buildHeaderCell('Insurer *', 90),
|
_buildHeaderCell('Insurer *', 90),
|
||||||
_buildHeaderCell('Insured Name *', 110),
|
_buildHeaderCell('Insured Name *', 110),
|
||||||
_buildHeaderCell('Vehicle No *', 90),
|
_buildHeaderCell('Vehicle No *', 90),
|
||||||
_buildHeaderCell('Action', 80),
|
_buildHeaderCell('Action', 110),
|
||||||
|
_buildHeaderCell('Status', 100),
|
||||||
// _buildHeaderCell('Assigned Date', 100),
|
// _buildHeaderCell('Assigned Date', 100),
|
||||||
// _buildHeaderCell('Premium', 100),
|
// _buildHeaderCell('Premium', 100),
|
||||||
_buildHeaderCell('Payment Mode', 130),
|
_buildHeaderCell('Payment Mode', 130),
|
||||||
_buildHeaderCell('Plan Type', 130),
|
_buildHeaderCell('Plan Type', 130),
|
||||||
|
|
||||||
_buildHeaderCell('Policy Number', 120),
|
_buildHeaderCell('Policy', 120),
|
||||||
_buildHeaderCell('Status', 100),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -4452,6 +4666,76 @@ class EnquiryStaffState extends ConsumerState<EnquiryListStaffInline> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget _buildStyledTabs() {
|
||||||
|
return Container(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 4),
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
// color: Colors.amber,
|
||||||
|
// border: Border(bottom: BorderSide(color: Color(0xFFE5E5E5), width: 1)),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: List.generate(enquiryTabs.length, (index) {
|
||||||
|
final bool isSelected = selectedIndex == index;
|
||||||
|
|
||||||
|
return MouseRegion(
|
||||||
|
cursor: SystemMouseCursors.click,
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
setState(() {
|
||||||
|
selectedIndex = index;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
child: AnimatedContainer(
|
||||||
|
duration: const Duration(milliseconds: 250),
|
||||||
|
curve: Curves.easeOut,
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
vertical: 5,
|
||||||
|
horizontal: 20,
|
||||||
|
),
|
||||||
|
margin: const EdgeInsets.only(right: 24),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(6),
|
||||||
|
color: isSelected
|
||||||
|
? const Color(0xFF2E7D6E).withOpacity(0.08)
|
||||||
|
: Colors.transparent,
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
// mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
enquiryTabs[index],
|
||||||
|
style: GoogleFonts.poppins(
|
||||||
|
fontSize: 12,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: isSelected
|
||||||
|
? const Color(0xFF2E7D6E)
|
||||||
|
: Colors.black87,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
// const SizedBox(height: 3),
|
||||||
|
|
||||||
|
// ▬▬ Underline Indicator ▬▬
|
||||||
|
AnimatedContainer(
|
||||||
|
duration: const Duration(milliseconds: 250),
|
||||||
|
height: 3,
|
||||||
|
width: isSelected ? 40 : 0,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: const Color(0xFF2E7D6E),
|
||||||
|
borderRadius: BorderRadius.circular(50),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
static final _dataBold = GoogleFonts.inter(
|
static final _dataBold = GoogleFonts.inter(
|
||||||
fontSize: 11,
|
fontSize: 11,
|
||||||
|
|
||||||
|
|||||||
@ -381,6 +381,7 @@ class RaiseEnqFormState extends ConsumerState<RaiseEnqForm> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
child: FocusTraversalGroup(
|
||||||
child: Form(
|
child: Form(
|
||||||
key: _formKey,
|
key: _formKey,
|
||||||
child: Row(
|
child: Row(
|
||||||
@ -405,6 +406,7 @@ class RaiseEnqFormState extends ConsumerState<RaiseEnqForm> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
3039
lib/presentation/screens/staff/Enquiry/staff_policy.dart
Normal file
3039
lib/presentation/screens/staff/Enquiry/staff_policy.dart
Normal file
File diff suppressed because it is too large
Load Diff
@ -52,7 +52,7 @@ class SideDrawerPanel extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
if (title != null)
|
if (title != null)
|
||||||
Text(
|
Text(
|
||||||
'Proposal Creation',
|
title!,
|
||||||
style: GoogleFonts.poppins(
|
style: GoogleFonts.poppins(
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
|
|||||||
@ -31,6 +31,8 @@ class ThemedFormInlineField extends HookWidget {
|
|||||||
this.onChanged,
|
this.onChanged,
|
||||||
this.isdense,
|
this.isdense,
|
||||||
this.padVertical,
|
this.padVertical,
|
||||||
|
this.errFieldFont,
|
||||||
|
this.errFieldHgt,
|
||||||
});
|
});
|
||||||
|
|
||||||
final String? hintText;
|
final String? hintText;
|
||||||
@ -47,6 +49,8 @@ class ThemedFormInlineField extends HookWidget {
|
|||||||
final Color? highlightColor;
|
final Color? highlightColor;
|
||||||
final Color? textColr;
|
final Color? textColr;
|
||||||
final double? txtwidth;
|
final double? txtwidth;
|
||||||
|
final double? errFieldFont;
|
||||||
|
final double? errFieldHgt;
|
||||||
final bool readOnly;
|
final bool readOnly;
|
||||||
final bool? isdense;
|
final bool? isdense;
|
||||||
final bool? isShowCursor;
|
final bool? isShowCursor;
|
||||||
@ -84,7 +88,16 @@ class ThemedFormInlineField extends HookWidget {
|
|||||||
);
|
);
|
||||||
final inputDecoration = InputDecoration(
|
final inputDecoration = InputDecoration(
|
||||||
isDense: isdense ?? false,
|
isDense: isdense ?? false,
|
||||||
errorStyle: TextStyle(color: Color(0xFFD83731)),
|
// errorStyle: const TextStyle(
|
||||||
|
// fontSize: 9,
|
||||||
|
//
|
||||||
|
// // height: 0.0
|
||||||
|
// ),
|
||||||
|
errorStyle: TextStyle(
|
||||||
|
color: Color(0xFFD83731),
|
||||||
|
fontSize: errFieldFont ?? 12,
|
||||||
|
height: errFieldHgt ?? 10,
|
||||||
|
),
|
||||||
errorBorder: OutlineInputBorder(
|
errorBorder: OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.circular(5),
|
borderRadius: BorderRadius.circular(5),
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user