FOREX DWNLD

This commit is contained in:
venbaittech 2025-08-01 16:48:08 +05:30
parent a32fb0d0c3
commit b24215272f
18 changed files with 2047 additions and 1657 deletions

View File

@ -540,7 +540,12 @@ class _ListAllPlansState extends State<ListAllPlans> {
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Row( Padding(
padding:
isDesktop
? const EdgeInsets.all(0)
: const EdgeInsets.only(left: 14.0),
child: Row(
children: [ children: [
Text( Text(
'All Trips', 'All Trips',
@ -558,6 +563,7 @@ class _ListAllPlansState extends State<ListAllPlans> {
), ),
], ],
), ),
),
SizedBox(width: 1), SizedBox(width: 1),
Spacer(), Spacer(),
@ -1153,7 +1159,7 @@ class _ListAllPlansState extends State<ListAllPlans> {
context, context,
); );
apiService apiService
.getPdfDownload( .getForexPdfDownload(
plan.forexId, plan.forexId,
); );
}, },
@ -1445,7 +1451,7 @@ class _ListAllPlansState extends State<ListAllPlans> {
context, context,
); );
apiService apiService
.getPdfDownload( .getForexPdfDownload(
plan.forexId, plan.forexId,
); );
}, },

View File

@ -395,7 +395,12 @@ class _TravelAgentListPlansState extends State<TravelAgentListPlans> {
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Row( Padding(
padding:
isDesktop
? const EdgeInsets.all(0)
: const EdgeInsets.only(left: 14.0),
child: Row(
children: [ children: [
Text( Text(
'Trips', 'Trips',
@ -412,6 +417,7 @@ class _TravelAgentListPlansState extends State<TravelAgentListPlans> {
), ),
], ],
), ),
),
Spacer(), Spacer(),
if (isDesktop) if (isDesktop)
@ -455,7 +461,7 @@ class _TravelAgentListPlansState extends State<TravelAgentListPlans> {
), ),
// SizedBox(width: 16), // SizedBox(width: 16),
Spacer(), // Spacer(),
// ElevatedButton( // ElevatedButton(
// style: ElevatedButton.styleFrom( // style: ElevatedButton.styleFrom(
// foregroundColor: Colors.white, // foregroundColor: Colors.white,
@ -905,7 +911,7 @@ class _TravelAgentListPlansState extends State<TravelAgentListPlans> {
context, context,
); );
apiService apiService
.getPdfDownload( .getForexPdfDownload(
plan.forexId, plan.forexId,
); );
}, },

View File

@ -755,7 +755,12 @@ class _ApprovalListState extends State<ApprovalList> {
// ), // ),
Row( Row(
children: [ children: [
Row( Padding(
padding:
isDesktop
? const EdgeInsets.all(0)
: const EdgeInsets.only(left: 14.0),
child: Row(
children: [ children: [
Text( Text(
'My Approvals', 'My Approvals',
@ -772,6 +777,7 @@ class _ApprovalListState extends State<ApprovalList> {
), ),
], ],
), ),
),
if (isDesktop) if (isDesktop)
SizedBox(width: MediaQuery.of(context).size.width * 0.23), SizedBox(width: MediaQuery.of(context).size.width * 0.23),
@ -1356,7 +1362,7 @@ class _ApprovalListState extends State<ApprovalList> {
context, context,
); );
apiService apiService
.getPdfDownload( .getForexPdfDownload(
plan.forexId, plan.forexId,
); );
}, },
@ -1665,7 +1671,7 @@ class _ApprovalListState extends State<ApprovalList> {
context, context,
); );
apiService apiService
.getPdfDownload( .getForexPdfDownload(
plan.forexId, plan.forexId,
); );
}, },

View File

@ -480,10 +480,10 @@ class StatusDashboardState extends State<StatusDashboard> {
child: Text( child: Text(
label, label,
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: 10, fontSize: 12,
color: color, color: color,
// color: const Color(0xFFEAF3FB), // color: const Color(0xFFEAF3FB),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w500,
), ),
), ),
), ),

View File

@ -1530,7 +1530,8 @@ class _ForexScreenState extends State<ForexScreen> {
else else
SizedBox(height: 8), SizedBox(height: 8),
Column( Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment:
isDesktop ? CrossAxisAlignment.center : CrossAxisAlignment.start,
children: [ children: [
Text( Text(
"Currency *", "Currency *",
@ -1552,19 +1553,24 @@ class _ForexScreenState extends State<ForexScreen> {
height: 40, height: 40,
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Center( child:
child: Text( isDesktop
// "cur", ? Center(child: currencyText())
// "${selectedCurrency}", : Container(child: currencyText()),
selectedCurrency ?? "Currency", // child: Center
// selectedCurrency?.isNotEmpty == true ? selectedCurrency! : "Currency", // (
style: const TextStyle( // child: Text(
fontSize: 12, // // "cur",
fontWeight: FontWeight.w600, // // "${selectedCurrency}",
color: Color(0xFF575A74), // selectedCurrency ?? "Currency",
), // // selectedCurrency?.isNotEmpty == true ? selectedCurrency! : "Currency",
), // style: const TextStyle(
), // fontSize: 12,
// fontWeight: FontWeight.w600,
// color: Color(0xFF575A74),
// ),
// ),
// ),
), ),
), ),
), ),
@ -1632,6 +1638,14 @@ class _ForexScreenState extends State<ForexScreen> {
]; ];
} }
Widget currencyText() => Text(
selectedCurrency ?? "Currency",
style: const TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xFF575A74),
),
);
List<Widget> _buildSecondRow(bool isDesktop) { List<Widget> _buildSecondRow(bool isDesktop) {
return [ return [
if (isDesktop) Spacer(), if (isDesktop) Spacer(),
@ -2344,7 +2358,8 @@ class _ForexScreenState extends State<ForexScreen> {
children: [ children: [
Row( Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: isDesktop ? MainAxisAlignment.center : MainAxisAlignment.start, mainAxisAlignment:
isDesktop ? MainAxisAlignment.center : MainAxisAlignment.start,
children: [ children: [
Container( Container(
alignment: Alignment.bottomLeft, alignment: Alignment.bottomLeft,

View File

@ -313,7 +313,7 @@ class _AccomodationListWidgetState extends State<AccomodationListWidget> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.end, // mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
Text( Text(
item["hotel_name"]!, item["hotel_name"]!,
@ -388,6 +388,7 @@ class _AccomodationListWidgetState extends State<AccomodationListWidget> {
], ],
) )
: SizedBox.shrink(), : SizedBox.shrink(),
SizedBox(height: 8),
isDesktop isDesktop
? Row( ? Row(
children: [ children: [
@ -640,29 +641,29 @@ class _AccomodationListWidgetState extends State<AccomodationListWidget> {
), ),
), ),
SizedBox(width: 5), SizedBox(width: 5),
Expanded(child: Text(value, style: TextStyle(fontSize: 12))), // Expanded(child: Text(value, style: TextStyle(fontSize: 12))),
// Expanded( Expanded(
// child: child:
// exceedsLimit exceedsLimit
// ? Tooltip( ? Tooltip(
// message: wrapText(value, 50), message: wrapText(value, 50),
// decoration: BoxDecoration( decoration: BoxDecoration(
// color: Colors.grey.shade200, // Black background color: Colors.grey.shade200, // Black background
// borderRadius: BorderRadius.circular(6), borderRadius: BorderRadius.circular(6),
// ), ),
// textStyle: TextStyle( textStyle: TextStyle(
// color: Colors.black, color: Colors.black,
// ), // Tooltip text color ), // Tooltip text color
// padding: EdgeInsets.all(8), padding: EdgeInsets.all(8),
// preferBelow: false, preferBelow: false,
// child: Text( child: Text(
// value.substring(0, limit) + "...", value.substring(0, limit) + "...",
// style: TextStyle(fontSize: 12), style: TextStyle(fontSize: 12),
// overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
// ), ),
// ) )
// : Text(value, style: TextStyle(fontSize: 12)), : Text(value, style: TextStyle(fontSize: 12)),
// ), ),
], ],
); );
} }

View File

@ -363,7 +363,7 @@ class _BusListWidgetState extends State<BusListWidget> {
], ],
) )
: SizedBox.shrink(), : SizedBox.shrink(),
SizedBox(height: 4), SizedBox(height: 8),
isDesktop isDesktop
? Row( ? Row(
children: [ children: [

View File

@ -319,7 +319,7 @@ class _ForexListWidgetState extends State<ForexListWidget> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.end, // mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
Text( Text(
getRequestForCountry(item["country_code"]!.toString()), getRequestForCountry(item["country_code"]!.toString()),
@ -344,19 +344,20 @@ class _ForexListWidgetState extends State<ForexListWidget> {
), ),
), ),
), ),
// SizedBox(width: 10), SizedBox(width: 10),
// GestureDetector( GestureDetector(
// onTap: () => onDeleteForex(item), onTap: () => widget.onDeleteForex(item),
// child: Tooltip( child: Tooltip(
// message: 'Delete Forex Details', message: 'Delete Forex Details',
// child: Image.asset( child: Image.asset(
// 'assets/images/IconsImg/delete.png', 'assets/images/IconsImg/delete.png',
// width: 20, width: 20,
// height: 15, height: 15,
// color: Colors.red, color: Colors.red,
// ), ),
// ), ),
// ), ),
SizedBox(width: 10),
item['forex_id'] != null item['forex_id'] != null
? IconButton( ? IconButton(
icon: Icon( icon: Icon(
@ -457,6 +458,7 @@ class _ForexListWidgetState extends State<ForexListWidget> {
], ],
) )
: SizedBox.shrink(), : SizedBox.shrink(),
SizedBox(height: 8),
isDesktop isDesktop
? Row( ? Row(
children: [ children: [

View File

@ -324,6 +324,7 @@ class _InsuranceListWidgetState extends State<InsuranceListWidget> {
], ],
) )
: SizedBox.shrink(), : SizedBox.shrink(),
SizedBox(height: 8),
isDesktop isDesktop
? Row( ? Row(
children: [ children: [

View File

@ -273,7 +273,7 @@ class _MiscellaneousListWidgetState extends State<MiscellaneousListWidget> {
], ],
), ),
// Divider(color: Colors.blueGrey.shade50), // Divider(color: Colors.blueGrey.shade50),
// SizedBox(height: 4), SizedBox(height: 4),
isDesktop isDesktop
? Row( ? Row(
children: [ children: [
@ -294,6 +294,7 @@ class _MiscellaneousListWidgetState extends State<MiscellaneousListWidget> {
], ],
) )
: SizedBox.shrink(), : SizedBox.shrink(),
SizedBox(height: 8),
isDesktop isDesktop
? Row( ? Row(
children: [ children: [

View File

@ -378,7 +378,8 @@ class _TaxiListWidgetState extends State<TaxiListWidget> {
], ],
) )
: SizedBox.shrink(), : SizedBox.shrink(),
SizedBox(height: 4), SizedBox(height: 8),
isDesktop isDesktop
? Row( ? Row(
children: [ children: [

View File

@ -450,7 +450,7 @@ class _TrainListWidgetState extends State<TrainListWidget> {
], ],
) )
: SizedBox.shrink(), : SizedBox.shrink(),
SizedBox(height: 4), SizedBox(height: 8),
isDesktop isDesktop
? Row( ? Row(
children: [ children: [

View File

@ -427,6 +427,7 @@ class _VisaListWidgetState extends State<VisaListWidget> {
], ],
) )
: SizedBox.shrink(), : SizedBox.shrink(),
SizedBox(height: 8),
isDesktop isDesktop
? Row( ? Row(
children: [ children: [

View File

@ -58,6 +58,21 @@ class _ColorThemePickerWidgetState extends State<ColorThemePickerWidget> {
]; ];
final List<Color> layoutTertiaryColors = [ final List<Color> layoutTertiaryColors = [
Color(0xFFE5EFFF), // Very Light Blue
Color(0xFFE6FDFF), // Very Light Teal
Color(0xFFE8FDEF), // Mint Green
Color(0xFFFFE7E6), // Light Coral/Red
Color(0xFFFDE9E7), // Peach
Color(0xFFFFF5E5), // Lightest Orange
Color(0xFFECEEF8), // Very Light Rose
Color(0xFFE5FFFC), // Pastel Pink
Color(0xFFFEE6F3), // Light Lavender
Color(0xFFF9EBF3), // Soft Purple Grey
Color(0xFFF8EAFA), // Near-white Neutral
Color(0xFFF4EDF7), // Near-white Neutral
];
final List<Color> layoutTertiaryColors1 = [
Color(0xFFE3F2FD), // Very Light Blue Color(0xFFE3F2FD), // Very Light Blue
Color(0xFFE0F7FA), // Very Light Teal Color(0xFFE0F7FA), // Very Light Teal
Color(0xFFC8E6C9), // Mint Green Color(0xFFC8E6C9), // Mint Green
@ -67,7 +82,7 @@ class _ColorThemePickerWidgetState extends State<ColorThemePickerWidget> {
Color(0xFFFFEBEE), // Very Light Rose Color(0xFFFFEBEE), // Very Light Rose
Color(0xFFFCE4EC), // Pastel Pink Color(0xFFFCE4EC), // Pastel Pink
Color(0xFFF3E5F5), // Light Lavender Color(0xFFF3E5F5), // Light Lavender
Color(0xFFEDE7F6), // Soft Purple Grey Color(0xFFF9EBF3), // Soft Purple Grey
Color(0xFFF8F9FA), // Near-white Neutral Color(0xFFF8F9FA), // Near-white Neutral
]; ];

View File

@ -446,6 +446,7 @@ class CreateNewPlansState extends State<CreateNewPlan> {
String? _selectedIsBillable; String? _selectedIsBillable;
String? selectedFuncDept; String? selectedFuncDept;
String? selectedPurpose; String? selectedPurpose;
bool hasUpdateVal = false;
Map<String, String?> validationErrors = {}; Map<String, String?> validationErrors = {};
@ -563,6 +564,10 @@ class CreateNewPlansState extends State<CreateNewPlan> {
loadInitialData(); loadInitialData();
}); });
// if (widget.selectedPlanData != null) {
// hasUpdateVal = true;
// }
if (widget.approverStatus == "Approval pending") { if (widget.approverStatus == "Approval pending") {
print("Status approver - Approval Pending"); print("Status approver - Approval Pending");
} }
@ -657,6 +662,8 @@ class CreateNewPlansState extends State<CreateNewPlan> {
planTravlrId = travellerId; planTravlrId = travellerId;
_selectedOption = "Option 3"; _selectedOption = "Option 3";
otherUserName = travellerName; otherUserName = travellerName;
hasUpdateVal = true;
} else if (userId.isNotEmpty && userId != "0") { } else if (userId.isNotEmpty && userId != "0") {
print("TestplanUsrId : $userId"); print("TestplanUsrId : $userId");
print("TestplanUsrIdSelf : $selfId"); print("TestplanUsrIdSelf : $selfId");
@ -664,6 +671,7 @@ class CreateNewPlansState extends State<CreateNewPlan> {
print("TestplanUsrId2 : $planUsrId"); print("TestplanUsrId2 : $planUsrId");
_selectedOption = (selfId != userId) ? "Option 2" : "Option 1"; _selectedOption = (selfId != userId) ? "Option 2" : "Option 1";
otherUserName = userName; otherUserName = userName;
hasUpdateVal = true;
} }
}); });
} }
@ -2039,6 +2047,7 @@ class CreateNewPlansState extends State<CreateNewPlan> {
} }
return true; return true;
}, },
enabled: !hasUpdateVal,
popupProps: PopupProps.menu( popupProps: PopupProps.menu(
showSearchBox: false, // Optionally enable search showSearchBox: false, // Optionally enable search
fit: FlexFit.loose, fit: FlexFit.loose,
@ -3172,6 +3181,7 @@ class CreateNewPlansState extends State<CreateNewPlan> {
{"title": "Others (Non Employee)", "value": "Option 3"}, {"title": "Others (Non Employee)", "value": "Option 3"},
]; ];
print("isViewModeYY: ${widget.isViewMode}, hasUpdateVal: $hasUpdateVal");
return [ return [
CustomTextFieldWrapper( CustomTextFieldWrapper(
// isFocused: focusStates["trip_plannedFocused"] ?? false, // isFocused: focusStates["trip_plannedFocused"] ?? false,
@ -3198,12 +3208,14 @@ class CreateNewPlansState extends State<CreateNewPlan> {
// Request focus when user taps // Request focus when user taps
focusNodes["trip_plannedFocusNode"]?.requestFocus(); focusNodes["trip_plannedFocusNode"]?.requestFocus();
}, },
child: DropdownSearch<String>( child: DropdownSearch<String>(
selectedItem: selectedItem:
options.firstWhere( options.firstWhere(
(opt) => opt['value'] == _selectedOption, (opt) => opt['value'] == _selectedOption,
)['title'], )['title'],
enabled: !widget.isViewMode, enabled: !hasUpdateVal,
// enabled: || !hasUpdateVal,
items: options.map((opt) => opt['title']!).toList(), items: options.map((opt) => opt['title']!).toList(),
popupProps: PopupProps.menu( popupProps: PopupProps.menu(
showSearchBox: false, showSearchBox: false,

View File

@ -679,7 +679,12 @@ class _ListPlansState extends State<ListPlans> {
// thickness: 0.2, // how "thick" the line is // thickness: 0.2, // how "thick" the line is
// color: Colors.grey, // optional // color: Colors.grey, // optional
// ), // ),
Row( Padding(
padding:
isDesktop
? const EdgeInsets.all(8.0)
: const EdgeInsets.symmetric(horizontal: 14.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Row( Row(
@ -839,6 +844,7 @@ class _ListPlansState extends State<ListPlans> {
), ),
], ],
), ),
),
if (!isDesktop) const SizedBox(height: 10), if (!isDesktop) const SizedBox(height: 10),
if (!isDesktop) if (!isDesktop)
Row( Row(
@ -1316,7 +1322,7 @@ class _ListPlansState extends State<ListPlans> {
context, context,
); );
apiService apiService
.getPdfDownload( .getForexPdfDownload(
plan.forexId, plan.forexId,
); );
}, },
@ -1633,7 +1639,7 @@ class _ListPlansState extends State<ListPlans> {
context, context,
); );
apiService apiService
.getPdfDownload( .getForexPdfDownload(
plan.forexId, plan.forexId,
); );
}, },

View File

@ -103,7 +103,6 @@ class _PolicyState extends State<Policy> {
}); });
}).toList(); }).toList();
Map<String, dynamic> data = { Map<String, dynamic> data = {
"name": _policyController.text, "name": _policyController.text,
"domestic": SelectedDomestic, "domestic": SelectedDomestic,
@ -155,6 +154,7 @@ class _PolicyState extends State<Policy> {
// } // }
// }); // });
} }
void _addFocusListener(FocusNode node, Function(bool) updateState) { void _addFocusListener(FocusNode node, Function(bool) updateState) {
node.addListener(() { node.addListener(() {
setState(() { setState(() {
@ -162,6 +162,7 @@ class _PolicyState extends State<Policy> {
}); });
}); });
} }
void _checkAuthAndLoadData() async { void _checkAuthAndLoadData() async {
final String? token = await getToken(); // Your async function to get token final String? token = await getToken(); // Your async function to get token
@ -181,9 +182,6 @@ class _PolicyState extends State<Policy> {
loadInitialData(); loadInitialData();
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
if (widget.policy != null) { if (widget.policy != null) {
final details = List<Map<String, dynamic>>.from( final details = List<Map<String, dynamic>>.from(
@ -193,7 +191,6 @@ class _PolicyState extends State<Policy> {
} }
}); });
// if (widget.policy != null) { // if (widget.policy != null) {
// print("185"); // print("185");
// final details = List<Map<String, dynamic>>.from( // final details = List<Map<String, dynamic>>.from(
@ -313,30 +310,29 @@ class _PolicyState extends State<Policy> {
}); });
print("298 ServicesChoosed ${ServicesChoosed}"); print("298 ServicesChoosed ${ServicesChoosed}");
if (ServicesChoosed!.isNotEmpty) { if (ServicesChoosed!.isNotEmpty) {
print("Filtered Selected Services ChooesedIpfa1: $ServicesChoosed"); print("Filtered Selected Services ChooesedIpfa1: $ServicesChoosed");
ServicesChoosed!.sort( ServicesChoosed!.sort(
(a, b) => (a['order'] ?? 0).compareTo(b['order'] ?? 0), (a, b) => (a['order'] ?? 0).compareTo(b['order'] ?? 0),
); );
String firstServiceName = ServicesChoosed?.first['name']; String firstServiceName = ServicesChoosed?.first['name'];
String firstServiceId = ServicesChoosed?.first['service_id']; String firstServiceId = ServicesChoosed?.first['service_id'];
print("✅ 306 First service name selected for filter: $firstServiceName - $firstServiceId"); print(
"✅ 306 First service name selected for filter: $firstServiceName - $firstServiceId",
);
selectedService = firstServiceName; selectedService = firstServiceName;
if (selectedServiceDBValue.value == "0") { if (selectedServiceDBValue.value == "0") {
setState(() { setState(() {
selectedServiceDBValue.value = firstServiceId.toString(); selectedServiceDBValue.value = firstServiceId.toString();
}); });
} }
List<int> serviceDBvalue = ServicesChoosed! List<int> serviceDBvalue =
ServicesChoosed!
.map((item) => int.parse(item['service_id'].toString())) .map((item) => int.parse(item['service_id'].toString()))
.toList(); .toList();
serviceDBValueList = serviceDBvalue; serviceDBValueList = serviceDBvalue;
} }
print(widget.policy); print(widget.policy);
// updateData(); // updateData();
@ -357,14 +353,10 @@ class _PolicyState extends State<Policy> {
}); });
print("✅ Loaded services from policy (decoded): $services"); print("✅ Loaded services from policy (decoded): $services");
} }
print("Filtered Selected Services Added to Policy: $ServicesChoosed"); print("Filtered Selected Services Added to Policy: $ServicesChoosed");
} else {
}
else {
final filtered = final filtered =
selectedAllServices! selectedAllServices!
.where( .where(
@ -404,7 +396,9 @@ class _PolicyState extends State<Policy> {
); );
String firstServiceName = ServicesChoosed?.first['name']; String firstServiceName = ServicesChoosed?.first['name'];
String firstServiceId = ServicesChoosed?.first['service_id']; String firstServiceId = ServicesChoosed?.first['service_id'];
print("✅ 363 First service name selected for filter: $firstServiceName - $firstServiceId"); print(
"✅ 363 First service name selected for filter: $firstServiceName - $firstServiceId",
);
selectedService = firstServiceName; selectedService = firstServiceName;
if (selectedServiceDBValue.value == "0") { if (selectedServiceDBValue.value == "0") {
setState(() { setState(() {
@ -412,12 +406,11 @@ class _PolicyState extends State<Policy> {
}); });
} }
List<int> serviceDBvalue = ServicesChoosed! List<int> serviceDBvalue =
ServicesChoosed!
.map((item) => int.parse(item['service_id'].toString())) .map((item) => int.parse(item['service_id'].toString()))
.toList(); .toList();
serviceDBValueList = serviceDBvalue; serviceDBValueList = serviceDBvalue;
} }
} }
} }
@ -525,7 +518,6 @@ class _PolicyState extends State<Policy> {
}); });
} }
bool isValidData(Map<String, dynamic> data) { bool isValidData(Map<String, dynamic> data) {
errorMessages.clear(); // Reset previous errors errorMessages.clear(); // Reset previous errors
@ -859,7 +851,7 @@ class _PolicyState extends State<Policy> {
isDesktop isDesktop
? Container( ? Container(
// color: Colors.yellow.shade50, // color: Colors.yellow.shade50,
height: MediaQuery.of(context).size.height * 0.54, height: MediaQuery.of(context).size.height * 0.56,
child: SingleChildScrollView( child: SingleChildScrollView(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
child: Row( child: Row(
@ -1215,11 +1207,11 @@ class _PolicyState extends State<Policy> {
// List<int> serviceDBvalue = // List<int> serviceDBvalue =
// ServicesChoosed!.map((service) => int.parse(service['service_id'].toString())).toList(); // ServicesChoosed!.map((service) => int.parse(service['service_id'].toString())).toList();
List<int> serviceDBvalue = ServicesChoosed! List<int> serviceDBvalue =
ServicesChoosed!
.map((item) => int.parse(item['service_id'].toString())) .map((item) => int.parse(item['service_id'].toString()))
.toList(); .toList();
print("1093"); print("1093");
print(services); print(services);
print(serviceDBvalue); print(serviceDBvalue);
@ -1253,7 +1245,9 @@ class _PolicyState extends State<Policy> {
// max((MediaQuery.of(context).size.height * 0.09), 10) // max((MediaQuery.of(context).size.height * 0.09), 10)
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
print("1201 Selected Services - $service - Tab Index - $index Service Id- $serviceId"); print(
"1201 Selected Services - $service - Tab Index - $index Service Id- $serviceId",
);
setState(() { setState(() {
selectedServiceIndex.value = index.toString(); selectedServiceIndex.value = index.toString();
selectedServiceDBValue.value = serviceId.toString(); selectedServiceDBValue.value = serviceId.toString();
@ -1263,13 +1257,13 @@ class _PolicyState extends State<Policy> {
" selectedServiceIndex.value - ${selectedServiceIndex.value}", " selectedServiceIndex.value - ${selectedServiceIndex.value}",
); );
// policyCriteriaKey.currentState?.fieldForPolicy(); // policyCriteriaKey.currentState?.fieldForPolicy();
// policyCriteriaKey.currentState // policyCriteriaKey.currentState
// ?.addOrUpdatePolicy(selectedServiceIndex.value); // ?.addOrUpdatePolicy(selectedServiceIndex.value);
print("policyselectedService - $selectedService"); print("policyselectedService - $selectedService");
if (selectedService == "Flight" || if (selectedService == "Flight" ||
selectedService == "Train" || selectedService == "Accomodation") { selectedService == "Train" ||
selectedService == "Accomodation") {
showClass = true; showClass = true;
showCost = false; showCost = false;
// int serviceCode = selectedService == "Flight" ? 1 : 2; // int serviceCode = selectedService == "Flight" ? 1 : 2;
@ -1460,7 +1454,8 @@ class _PolicyState extends State<Policy> {
// color: Colors.brown.shade100, // color: Colors.brown.shade100,
// child: Text("data"), // child: Text("data"),
// color: Colors.white60, // color: Colors.white60,
child: (selectedService != null && selectedServiceDBValue.value != "0") child:
(selectedService != null && selectedServiceDBValue.value != "0")
? PolicyCriteria( ? PolicyCriteria(
key: policyCriteriaKey, key: policyCriteriaKey,
isDesktop: isDesktop, isDesktop: isDesktop,
@ -1469,7 +1464,8 @@ class _PolicyState extends State<Policy> {
selectedTabNotifier: selectedServiceIndex, selectedTabNotifier: selectedServiceIndex,
selectedIdNotifier: selectedServiceDBValue, selectedIdNotifier: selectedServiceDBValue,
selectedService: selectedService!, selectedService: selectedService!,
serviceDBValueList: serviceDBValueList, // 👈 Pass the array here serviceDBValueList:
serviceDBValueList, // 👈 Pass the array here
userId: userId, userId: userId,
onPolicyDataChanged: (List<Map<String, dynamic>>? policyData) { onPolicyDataChanged: (List<Map<String, dynamic>>? policyData) {
print("🟢 policyData received from child: $policyData"); print("🟢 policyData received from child: $policyData");
@ -1481,7 +1477,8 @@ class _PolicyState extends State<Policy> {
}); });
}); });
}, },
) : const Center(child: CircularProgressIndicator()), )
: const Center(child: CircularProgressIndicator()),
); );
} }

File diff suppressed because it is too large Load Diff