minor issues fixes 8

This commit is contained in:
venba-Inspriron-3558 2025-06-27 13:01:23 +05:30
parent 57f7f29054
commit 63e51d8c5f
13 changed files with 684 additions and 146 deletions

View File

@ -46,6 +46,7 @@ class _ListAllPlansState extends State<ListAllPlans> {
List<Plan> allPlans = []; List<Plan> allPlans = [];
List<Plan> filteredPlans = []; List<Plan> filteredPlans = [];
TextEditingController searchController = TextEditingController(); TextEditingController searchController = TextEditingController();
late bool _listDialogShown = false;
@override @override
void initState() { void initState() {
@ -289,6 +290,109 @@ class _ListAllPlansState extends State<ListAllPlans> {
} }
} }
Future<void> _showDetails(id) async {
_listDialogShown = true;
final String apiUrldata = '$apiUrl/api/plans/get_plan_approval_status?plan_id=$id';
final String? token = await getToken();
String label = "";
List<Map<String, dynamic>> approverData = [];
if (token == null) {
print('Token not found. Please log in.');
label = "Error - Token not found";
} else {
try {
final response = await http.get(
Uri.parse(apiUrldata),
headers: {
'Authorization': 'Bearer $token',
'Content-Type': 'application/json',
},
);
if (response.statusCode == 200) {
final data = json.decode(response.body);
label = data['data']['model_heading'] ?? "";
approverData = List<Map<String, dynamic>>.from(data['data']['approver_data'] ?? []);
} else {
print('Failed to load');
label = "Error - Failed to load data";
}
} catch (e) {
print('Exception occurred: $e');
label = "Error - Something went wrong";
}
}
showDialog(
context: context,
builder: (context) => AlertDialog(
title: Text(
label,
style: GoogleFonts.poppins(
fontSize: 18,
fontWeight: FontWeight.w600,
color: Colors.black,
),
overflow: TextOverflow.ellipsis,
),
content: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
if (approverData.isNotEmpty)
SizedBox(
height: 250,
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: SingleChildScrollView(
scrollDirection: Axis.vertical,
child: DataTable(
columns: [
// DataColumn(label: Text('S.No', style: GoogleFonts.poppins(fontSize: 14, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Approver ID', style: GoogleFonts.poppins(fontSize: 14, fontWeight: FontWeight.w600))),
DataColumn(label: Text('Status', style: GoogleFonts.poppins(fontSize: 14, fontWeight: FontWeight.w600))),
],
rows: approverData.asMap().entries.map((entry) {
final index = entry.key + 1;
final item = entry.value;
final approverIdKey = item.keys.firstWhere((k) => k.endsWith('_id'), orElse: () => '');
final statusKey = item.keys.firstWhere((k) => k.endsWith('_status'), orElse: () => '');
final approverId = item[approverIdKey]?.toString() ?? '-';
final statusText = item[statusKey]?.toString() ?? 'Unknown';
return DataRow(
cells: [
// DataCell(Text('$index')),
// DataCell(SizedBox(width: 120, child: Text(approverId, overflow: TextOverflow.ellipsis))),
DataCell(SizedBox(child: Text(statusText, overflow: TextOverflow.ellipsis))),
],
);
}).toList(),
),
),
),
)
else
Text("-- no data. --", style: GoogleFonts.poppins(fontSize: 14, fontWeight: FontWeight.w300)),
],
),
),
actions: [
TextButton(
onPressed: () {
Navigator.pop(context);
_listDialogShown = false;
},
child: Text("Close"),
),
],
),
);
}
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ResponsiveBuilder( return ResponsiveBuilder(
builder: (context, sizingInfo) { builder: (context, sizingInfo) {
@ -830,7 +934,9 @@ class _ListAllPlansState extends State<ListAllPlans> {
), ),
), ),
), ),
DataCell( DataCell(GestureDetector(
onTap: () => _showDetails(plan.planId),
child:
Container( Container(
width: width:
double double
@ -857,7 +963,7 @@ class _ListAllPlansState extends State<ListAllPlans> {
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
), ),
), ),
), ),),
), ),
DataCell( DataCell(
Row( Row(
@ -1050,7 +1156,9 @@ class _ListAllPlansState extends State<ListAllPlans> {
Column( Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [GestureDetector(
onTap: () => _showDetails(plan.planId),
child:
Container( Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
horizontal: 8, horizontal: 8,
@ -1074,7 +1182,7 @@ class _ListAllPlansState extends State<ListAllPlans> {
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
), ),),
], ],
), ),
Column( Column(

View File

@ -43,6 +43,9 @@ class _ApprovalListState extends State<ApprovalList> {
List<Plan> filteredPlans = []; List<Plan> filteredPlans = [];
TextEditingController searchController = TextEditingController(); TextEditingController searchController = TextEditingController();
late bool _dialogShown = false;
Map<String, dynamic> successList = {};
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -374,6 +377,242 @@ class _ApprovalListState extends State<ApprovalList> {
print("filteredPlans: $filteredPlans"); print("filteredPlans: $filteredPlans");
} }
// Future<void> _showDetails(Id) async {
// _dialogShown = true;
// final String apiUrldata = '$apiUrl/api/plans/get_plan_approval_status?plan_id=$Id';
// final String? token = await getToken();
//
// if (token == null) {
// print('Token not found. Please log in.');
// successList = {
// "model_heading": "Error - Token not found",
// "approver_data": [],
// };
// } else {
// try {
// final response = await http.get(
// Uri.parse(apiUrldata),
// headers: {
// 'Authorization': 'Bearer $token',
// 'Content-Type': 'application/json',
// },
// );
//
// if (response.statusCode == 200) {
// final data = json.decode(response.body);
// print(data['data']);
// successList = data['data'];
// } else {
// print('Failed to load');
// successList = {
// "model_heading": "Error - Failed to load data",
// "approver_data": [],
// };
// }
// } catch (e) {
// print('Exception occurred: $e');
// successList = {
// "model_heading": "Error - Something went wrong",
// "approver_data": [],
// };
// }
// }
//
// showDialog(
// context: context,
// builder: (context) => AlertDialog(
// title: Text(
// successList["model_heading"] ?? '',
// style: GoogleFonts.poppins(
// fontSize: 18,
// fontWeight: FontWeight.w600,
// color: Colors.black,
// ),
// overflow: TextOverflow.ellipsis,
// ),
// content: SingleChildScrollView(
// child: Column(
// mainAxisSize: MainAxisSize.min,
// children: [
// // Text(
// // successList["Trip Title"] ?? '',
// // style: TextStyle(fontWeight: FontWeight.bold),
// // ),
// const SizedBox(height: 8),
// (successList["approver_data"] != null && successList["approver_data"].isNotEmpty)
// ? SizedBox(
// height: 250,
// child: SingleChildScrollView(
// scrollDirection: Axis.horizontal,
// child: SingleChildScrollView(
// scrollDirection: Axis.vertical,
// child: DataTable(
// columns: [
// DataColumn(label: Text('S.No', style: GoogleFonts.poppins(
// fontSize: 14, fontWeight: FontWeight.w600, color: Colors.black,
// ))),
// DataColumn(label: Text('ID', style: GoogleFonts.poppins(
// fontSize: 14, fontWeight: FontWeight.w600, color: Colors.black,
// ))),
// DataColumn(label: Text('Reason', style: GoogleFonts.poppins(
// fontSize: 14, fontWeight: FontWeight.w600, color: Colors.black,
// ))),
// ],
// rows: successList["approver_data"].asMap().entries.map((entry) {
// final index = entry.key + 1;
// final rawData = entry.value['a1_id'];
// final data = (rawData == null || rawData.toString().trim().isEmpty) ? '-' : rawData.toString();
// final reason = entry.value['a1_status'] ?? 'Unknown';
//
// return DataRow(
// cells: [
// DataCell(Text('$index', style: GoogleFonts.poppins(
// fontSize: 14, fontWeight: FontWeight.w400, color: Colors.black,
// ))),
// DataCell(SizedBox(
// width: 180,
// child: Text(data, style: GoogleFonts.poppins(
// fontSize: 14, fontWeight: FontWeight.w400, color: Colors.black,
// ), overflow: TextOverflow.ellipsis),
// )),
// DataCell(SizedBox(
// width: 280,
// child: Text(reason, style: GoogleFonts.poppins(
// fontSize: 14, fontWeight: FontWeight.w400, color: Colors.black,
// ), overflow: TextOverflow.ellipsis),
// )),
// ],
// );
// }).toList(),
// ),
// ),
// ),
// )
// : Text("-- no data. --", style: GoogleFonts.poppins(
// fontSize: 14, fontWeight: FontWeight.w200, color: Colors.black,
// )),
// ],
// ),
// ),
// actions: [
// TextButton(
// onPressed: () {
// Navigator.pop(context);
// _dialogShown = false;
// },
// child: Text("Close"),
// ),
// ],
// ),
// );
// }
Future<void> _showDetails(id) async {
_dialogShown = true;
final String apiUrldata = '$apiUrl/api/plans/get_plan_approval_status?plan_id=$id';
final String? token = await getToken();
String label = "";
List<Map<String, dynamic>> approverData = [];
if (token == null) {
print('Token not found. Please log in.');
label = "Error - Token not found";
} else {
try {
final response = await http.get(
Uri.parse(apiUrldata),
headers: {
'Authorization': 'Bearer $token',
'Content-Type': 'application/json',
},
);
if (response.statusCode == 200) {
final data = json.decode(response.body);
label = data['data']['model_heading'] ?? "";
approverData = List<Map<String, dynamic>>.from(data['data']['approver_data'] ?? []);
} else {
print('Failed to load');
label = "Error - Failed to load data";
}
} catch (e) {
print('Exception occurred: $e');
label = "Error - Something went wrong";
}
}
showDialog(
context: context,
builder: (context) => AlertDialog(
title: Text(
label,
style: GoogleFonts.poppins(
fontSize: 18,
fontWeight: FontWeight.w600,
color: Colors.black,
),
overflow: TextOverflow.ellipsis,
),
content: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
if (approverData.isNotEmpty)
SizedBox(
height: 250,
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: SingleChildScrollView(
scrollDirection: Axis.vertical,
child: DataTable(
columns: [
// DataColumn(label: Text('S.No', style: GoogleFonts.poppins(fontSize: 14, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Approver ID', style: GoogleFonts.poppins(fontSize: 14, fontWeight: FontWeight.w600))),
DataColumn(label: Text('Status', style: GoogleFonts.poppins(fontSize: 14, fontWeight: FontWeight.w600))),
],
rows: approverData.asMap().entries.map((entry) {
final index = entry.key + 1;
final item = entry.value;
final approverIdKey = item.keys.firstWhere((k) => k.endsWith('_id'), orElse: () => '');
final statusKey = item.keys.firstWhere((k) => k.endsWith('_status'), orElse: () => '');
final approverId = item[approverIdKey]?.toString() ?? '-';
final statusText = item[statusKey]?.toString() ?? 'Unknown';
return DataRow(
cells: [
// DataCell(Text('$index')),
// DataCell(SizedBox(width: 120, child: Text(approverId, overflow: TextOverflow.ellipsis))),
DataCell(SizedBox(child: Text(statusText, overflow: TextOverflow.ellipsis))),
],
);
}).toList(),
),
),
),
)
else
Text("-- no data. --", style: GoogleFonts.poppins(fontSize: 14, fontWeight: FontWeight.w300)),
],
),
),
actions: [
TextButton(
onPressed: () {
Navigator.pop(context);
_dialogShown = false;
},
child: Text("Close"),
),
],
),
);
}
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ResponsiveBuilder( return ResponsiveBuilder(
builder: (context, sizingInfo) { builder: (context, sizingInfo) {
@ -864,37 +1103,60 @@ class _ApprovalListState extends State<ApprovalList> {
), ),
), ),
), ),
// DataCell(
// Container(
// width:
// double
// .infinity, // Set your desired fixed size (equal width and height)
// height: 25,
// alignment: Alignment.center,
// decoration: BoxDecoration(
// color: getStatusColor(
// plan.statusValue,
// ),
// borderRadius: BorderRadius.circular(
// 8,
// ),
// ),
//
// child: Text(
// plan.statusValue,
// textAlign: TextAlign.center,
// style: TextStyle(
// color: getStatusTextColor(
// plan.statusValue,
// ),
// fontSize: 12,
// fontFamily: "Inter",
// fontWeight: FontWeight.w400,
// ),
// ),
// ),
// ),
DataCell( DataCell(
Container( GestureDetector(
width: onTap: () => _showDetails(plan.planId),
double child: Container(
.infinity, // Set your desired fixed size (equal width and height) width: double.infinity,
height: 25, height: 25,
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
color: getStatusColor( color: getStatusColor(plan.statusValue),
borderRadius: BorderRadius.circular(8),
),
child: Text(
plan.statusValue, plan.statusValue,
), textAlign: TextAlign.center,
borderRadius: BorderRadius.circular( style: TextStyle(
8, color: getStatusTextColor(plan.statusValue),
), fontSize: 12,
), fontFamily: "Inter",
fontWeight: FontWeight.w400,
child: Text(
plan.statusValue,
textAlign: TextAlign.center,
style: TextStyle(
color: getStatusTextColor(
plan.statusValue,
), ),
fontSize: 12,
fontFamily: "Inter",
fontWeight: FontWeight.w400,
), ),
), ),
), ),
), ),
DataCell( DataCell(
Row( Row(
children: [ children: [
@ -1145,23 +1407,26 @@ class _ApprovalListState extends State<ApprovalList> {
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.spaceBetween, MainAxisAlignment.spaceBetween,
children: [ children: [
Container( GestureDetector(
padding: EdgeInsets.symmetric( onTap: () => _showDetails(plan.planId),
horizontal: 8, child: Container(
vertical: 4, padding: EdgeInsets.symmetric(
), horizontal: 8,
decoration: BoxDecoration( vertical: 4,
color: getStatusColor(plan.statusValue), ),
borderRadius: BorderRadius.circular(8), decoration: BoxDecoration(
), color: getStatusColor(plan.statusValue),
child: Text( borderRadius: BorderRadius.circular(8),
plan.statusValue, ),
style: TextStyle( child: Text(
color: getStatusTextColor( plan.statusValue,
plan.statusValue, style: TextStyle(
color: getStatusTextColor(
plan.statusValue,
),
fontSize: 10,
fontWeight: FontWeight.w600,
), ),
fontSize: 10,
fontWeight: FontWeight.w600,
), ),
), ),
), ),

View File

@ -52,6 +52,7 @@ class _ListPlansState extends State<ListPlans> {
String? location; String? location;
late bool _dialogShown = false; late bool _dialogShown = false;
late bool _listDialogShown = false;
late StreamSubscription<html.PopStateEvent> _popStateListener; late StreamSubscription<html.PopStateEvent> _popStateListener;
@override @override
@ -421,6 +422,109 @@ class _ListPlansState extends State<ListPlans> {
} }
} }
Future<void> _showDetails(id) async {
_listDialogShown = true;
final String apiUrldata = '$apiUrl/api/plans/get_plan_approval_status?plan_id=$id';
final String? token = await getToken();
String label = "";
List<Map<String, dynamic>> approverData = [];
if (token == null) {
print('Token not found. Please log in.');
label = "Error - Token not found";
} else {
try {
final response = await http.get(
Uri.parse(apiUrldata),
headers: {
'Authorization': 'Bearer $token',
'Content-Type': 'application/json',
},
);
if (response.statusCode == 200) {
final data = json.decode(response.body);
label = data['data']['model_heading'] ?? "";
approverData = List<Map<String, dynamic>>.from(data['data']['approver_data'] ?? []);
} else {
print('Failed to load');
label = "Error - Failed to load data";
}
} catch (e) {
print('Exception occurred: $e');
label = "Error - Something went wrong";
}
}
showDialog(
context: context,
builder: (context) => AlertDialog(
title: Text(
label,
style: GoogleFonts.poppins(
fontSize: 18,
fontWeight: FontWeight.w600,
color: Colors.black,
),
overflow: TextOverflow.ellipsis,
),
content: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
if (approverData.isNotEmpty)
SizedBox(
height: 250,
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: SingleChildScrollView(
scrollDirection: Axis.vertical,
child: DataTable(
columns: [
// DataColumn(label: Text('S.No', style: GoogleFonts.poppins(fontSize: 14, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Approver ID', style: GoogleFonts.poppins(fontSize: 14, fontWeight: FontWeight.w600))),
DataColumn(label: Text('Status', style: GoogleFonts.poppins(fontSize: 14, fontWeight: FontWeight.w600))),
],
rows: approverData.asMap().entries.map((entry) {
final index = entry.key + 1;
final item = entry.value;
final approverIdKey = item.keys.firstWhere((k) => k.endsWith('_id'), orElse: () => '');
final statusKey = item.keys.firstWhere((k) => k.endsWith('_status'), orElse: () => '');
final approverId = item[approverIdKey]?.toString() ?? '-';
final statusText = item[statusKey]?.toString() ?? 'Unknown';
return DataRow(
cells: [
// DataCell(Text('$index')),
// DataCell(SizedBox(width: 120, child: Text(approverId, overflow: TextOverflow.ellipsis))),
DataCell(SizedBox(child: Text(statusText, overflow: TextOverflow.ellipsis))),
],
);
}).toList(),
),
),
),
)
else
Text("-- no data. --", style: GoogleFonts.poppins(fontSize: 14, fontWeight: FontWeight.w300)),
],
),
),
actions: [
TextButton(
onPressed: () {
Navigator.pop(context);
_listDialogShown = false;
},
child: Text("Close"),
),
],
),
);
}
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ResponsiveBuilder( return ResponsiveBuilder(
builder: (context, sizingInfo) { builder: (context, sizingInfo) {
@ -962,7 +1066,10 @@ class _ListPlansState extends State<ListPlans> {
), ),
), ),
DataCell( DataCell(
Container( GestureDetector(
onTap: () => _showDetails(plan.planId),
child:
Container(
width: width:
double double
.infinity, // Set your desired fixed size (equal width and height) .infinity, // Set your desired fixed size (equal width and height)
@ -1006,7 +1113,7 @@ class _ListPlansState extends State<ListPlans> {
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
), ),
), ),
), ),),
), ),
DataCell( DataCell(
Row( Row(
@ -1242,7 +1349,9 @@ class _ListPlansState extends State<ListPlans> {
Row( Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.spaceBetween, MainAxisAlignment.spaceBetween,
children: [ children: [GestureDetector(
onTap: () => _showDetails(plan.planId),
child:
Container( Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
horizontal: 8, horizontal: 8,
@ -1262,7 +1371,7 @@ class _ListPlansState extends State<ListPlans> {
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
), ),),
// PlanPopupMenu( // PlanPopupMenu(
// plan: plan, // plan: plan,
// deletePlan: deletePlan, // deletePlan: deletePlan,

View File

@ -441,7 +441,7 @@ class _AdvancePurchaseState extends State<AdvancePurchase>
false) || false) ||
(object['so_number']?.toLowerCase().contains(lowerQuery) ?? (object['so_number']?.toLowerCase().contains(lowerQuery) ??
false) || false) ||
(object['functional_department']?.toLowerCase().contains( (object['cost_center']?.toLowerCase().contains(
lowerQuery, lowerQuery,
) ?? ) ??
false) || false) ||
@ -497,7 +497,7 @@ class _AdvancePurchaseState extends State<AdvancePurchase>
false) || false) ||
(object['so_number']?.toLowerCase().contains(lowerQuery) ?? (object['so_number']?.toLowerCase().contains(lowerQuery) ??
false) || false) ||
(object['functional_department']?.toLowerCase().contains( (object['cost_center']?.toLowerCase().contains(
lowerQuery, lowerQuery,
) ?? ) ??
false) || false) ||
@ -837,7 +837,7 @@ class _AdvancePurchaseState extends State<AdvancePurchase>
// DataColumn(label: Text('Plan Id', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Plan Id', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Employee Code', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Employee Code', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('SO Number', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('SO Number', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Department', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Cost Center', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Service', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Service', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Plan Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Plan Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('AdvPurch', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('AdvPurch', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
@ -847,7 +847,7 @@ class _AdvancePurchaseState extends State<AdvancePurchase>
// DataCell(Text('${entry['plan_id']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['plan_id']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['employee_code']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['employee_code']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['so_number']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['so_number']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['functional_department']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['cost_center']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['Service']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['Service']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['plan_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['plan_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['AdvPurch']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['AdvPurch']}', style: GoogleFonts.poppins(fontSize: 12))),
@ -985,7 +985,7 @@ class _AdvancePurchaseState extends State<AdvancePurchase>
), ),
DataColumn( DataColumn(
label: Text( label: Text(
'Department', 'Cost Center',
style: style:
GoogleFonts.poppins( GoogleFonts.poppins(
fontSize: 12, fontSize: 12,
@ -1107,7 +1107,7 @@ class _AdvancePurchaseState extends State<AdvancePurchase>
), ),
DataCell( DataCell(
Text( Text(
'${entry['functional_department']}', '${entry['cost_center']}',
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: fontSize:
12, 12,
@ -1333,7 +1333,7 @@ class _AdvancePurchaseState extends State<AdvancePurchase>
// DataColumn(label: Text('Plan Id', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Plan Id', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Employee Code', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Employee Code', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('SO Number', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('SO Number', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Department', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Cost Center', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Service', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Service', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Plan Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Plan Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('AdvPurch', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('AdvPurch', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
@ -1343,7 +1343,7 @@ class _AdvancePurchaseState extends State<AdvancePurchase>
// DataCell(Text('${entry['plan_id']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['plan_id']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['employee_code']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['employee_code']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['so_number']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['so_number']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['functional_department']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['cost_center']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['Service']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['Service']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['plan_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['plan_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['AdvPurch']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['AdvPurch']}', style: GoogleFonts.poppins(fontSize: 12))),
@ -1563,7 +1563,7 @@ class _AdvancePurchaseState extends State<AdvancePurchase>
), ),
DataColumn( DataColumn(
label: Text( label: Text(
'Department', 'Cost Center',
style: style:
GoogleFonts.poppins( GoogleFonts.poppins(
fontSize: 12, fontSize: 12,
@ -1685,7 +1685,7 @@ class _AdvancePurchaseState extends State<AdvancePurchase>
), ),
DataCell( DataCell(
Text( Text(
'${entry['functional_department']}', '${entry['cost_center']}',
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: fontSize:
12, 12,

View File

@ -385,7 +385,7 @@ class _GuestHouseState extends State<GuestHouse>
false) || false) ||
(object['so_number']?.toLowerCase().contains(lowerQuery) ?? (object['so_number']?.toLowerCase().contains(lowerQuery) ??
false) || false) ||
(object['functional_department']?.toLowerCase().contains( (object['cost_center']?.toLowerCase().contains(
lowerQuery, lowerQuery,
) ?? ) ??
false) || false) ||
@ -433,7 +433,7 @@ class _GuestHouseState extends State<GuestHouse>
false) || false) ||
(object['so_number']?.toLowerCase().contains(lowerQuery) ?? (object['so_number']?.toLowerCase().contains(lowerQuery) ??
false) || false) ||
(object['functional_department']?.toLowerCase().contains( (object['cost_center']?.toLowerCase().contains(
lowerQuery, lowerQuery,
) ?? ) ??
false) || false) ||
@ -777,7 +777,7 @@ class _GuestHouseState extends State<GuestHouse>
// DataColumn(label: Text('Plan Id', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Plan Id', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Employee Code', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Employee Code', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('SO Number', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('SO Number', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Department', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Cost Center', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Flight Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Flight Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Plan Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Plan Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Sector', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Sector', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
@ -787,7 +787,7 @@ class _GuestHouseState extends State<GuestHouse>
// DataCell(Text('${entry['plan_id']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['plan_id']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['employee_code']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['employee_code']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['so_number']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['so_number']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['functional_department']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['cost_center']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['flight_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['flight_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['plan_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['plan_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['sector']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['sector']}', style: GoogleFonts.poppins(fontSize: 12))),
@ -925,7 +925,7 @@ class _GuestHouseState extends State<GuestHouse>
), ),
DataColumn( DataColumn(
label: Text( label: Text(
'Department', 'Cost Center',
style: style:
GoogleFonts.poppins( GoogleFonts.poppins(
fontSize: 12, fontSize: 12,
@ -1039,7 +1039,7 @@ class _GuestHouseState extends State<GuestHouse>
), ),
DataCell( DataCell(
Text( Text(
'${entry['functional_department']}', '${entry['cost_center']}',
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: fontSize:
12, 12,
@ -1263,7 +1263,7 @@ class _GuestHouseState extends State<GuestHouse>
// DataColumn(label: Text('Plan Id', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Plan Id', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Employee Code', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Employee Code', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('SO Number', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('SO Number', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Department', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Cost Center', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Flight Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Flight Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Plan Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Plan Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Sector', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Sector', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
@ -1273,7 +1273,7 @@ class _GuestHouseState extends State<GuestHouse>
// DataCell(Text('${entry['plan_id']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['plan_id']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['employee_code']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['employee_code']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['so_number']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['so_number']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['functional_department']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['cost_center']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['flight_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['flight_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['plan_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['plan_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['sector']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['sector']}', style: GoogleFonts.poppins(fontSize: 12))),
@ -1459,7 +1459,7 @@ class _GuestHouseState extends State<GuestHouse>
// "employee_code": "TS_004", // "employee_code": "TS_004",
// "customer_name": "sangeetha E", // "customer_name": "sangeetha E",
// "so_number": "12345", // "so_number": "12345",
// "functional_department": "HR", // "cost_center": "HR",
// "flight_trip_type": "Roundtrip", // "flight_trip_type": "Roundtrip",
// "plan_trip_type": "international", // "plan_trip_type": "international",
// "sector": "Rajiv Gandhi International (Hyderabad) - Canadian Rockies Intl (Cranbrook)", // "sector": "Rajiv Gandhi International (Hyderabad) - Canadian Rockies Intl (Cranbrook)",
@ -1503,7 +1503,7 @@ class _GuestHouseState extends State<GuestHouse>
), ),
DataColumn( DataColumn(
label: Text( label: Text(
'Department', 'Cost Center',
style: style:
GoogleFonts.poppins( GoogleFonts.poppins(
fontSize: 12, fontSize: 12,
@ -1617,7 +1617,7 @@ class _GuestHouseState extends State<GuestHouse>
), ),
DataCell( DataCell(
Text( Text(
'${entry['functional_department']}', '${entry['cost_center']}',
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: fontSize:
12, 12,

View File

@ -408,7 +408,7 @@ class _MISairState extends State<MISair> with SingleTickerProviderStateMixin {
false) || false) ||
(object['so_number']?.toLowerCase().contains(lowerQuery) ?? (object['so_number']?.toLowerCase().contains(lowerQuery) ??
false) || false) ||
(object['functional_department']?.toLowerCase().contains( (object['cost_center']?.toLowerCase().contains(
lowerQuery, lowerQuery,
) ?? ) ??
false) || false) ||
@ -457,7 +457,7 @@ class _MISairState extends State<MISair> with SingleTickerProviderStateMixin {
false) || false) ||
(object['so_number']?.toLowerCase().contains(lowerQuery) ?? (object['so_number']?.toLowerCase().contains(lowerQuery) ??
false) || false) ||
(object['functional_department']?.toLowerCase().contains( (object['cost_center']?.toLowerCase().contains(
lowerQuery, lowerQuery,
) ?? ) ??
false) || false) ||
@ -801,7 +801,7 @@ class _MISairState extends State<MISair> with SingleTickerProviderStateMixin {
// DataColumn(label: Text('Plan Id', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Plan Id', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Employee Code', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Employee Code', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('SO Number', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('SO Number', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Department', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Cost Center', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Flight Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Flight Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Plan Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Plan Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Sector', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Sector', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
@ -811,7 +811,7 @@ class _MISairState extends State<MISair> with SingleTickerProviderStateMixin {
// DataCell(Text('${entry['plan_id']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['plan_id']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['employee_code']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['employee_code']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['so_number']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['so_number']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['functional_department']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['cost_center']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['flight_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['flight_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['plan_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['plan_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['sector']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['sector']}', style: GoogleFonts.poppins(fontSize: 12))),
@ -949,7 +949,7 @@ class _MISairState extends State<MISair> with SingleTickerProviderStateMixin {
), ),
DataColumn( DataColumn(
label: Text( label: Text(
'Department', 'Cost Center',
style: style:
GoogleFonts.poppins( GoogleFonts.poppins(
fontSize: 12, fontSize: 12,
@ -1063,7 +1063,7 @@ class _MISairState extends State<MISair> with SingleTickerProviderStateMixin {
), ),
DataCell( DataCell(
Text( Text(
'${entry['functional_department']}', '${entry['cost_center']}',
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: fontSize:
12, 12,
@ -1266,7 +1266,7 @@ class _MISairState extends State<MISair> with SingleTickerProviderStateMixin {
// DataColumn(label: Text('Plan Id', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Plan Id', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Employee Code', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Employee Code', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('SO Number', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('SO Number', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Department', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Cost Center', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Flight Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Flight Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Plan Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Plan Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Sector', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Sector', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
@ -1276,7 +1276,7 @@ class _MISairState extends State<MISair> with SingleTickerProviderStateMixin {
// DataCell(Text('${entry['plan_id']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['plan_id']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['employee_code']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['employee_code']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['so_number']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['so_number']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['functional_department']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['cost_center']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['flight_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['flight_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['plan_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['plan_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['sector']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['sector']}', style: GoogleFonts.poppins(fontSize: 12))),
@ -1469,7 +1469,7 @@ class _MISairState extends State<MISair> with SingleTickerProviderStateMixin {
), ),
DataColumn( DataColumn(
label: Text( label: Text(
'Department', 'Cost Center',
style: style:
GoogleFonts.poppins( GoogleFonts.poppins(
fontSize: 12, fontSize: 12,
@ -1583,7 +1583,7 @@ class _MISairState extends State<MISair> with SingleTickerProviderStateMixin {
), ),
DataCell( DataCell(
Text( Text(
'${entry['functional_department']}', '${entry['cost_center']}',
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: fontSize:
12, 12,

View File

@ -367,7 +367,7 @@ class _MISforexState extends State<MISforex>
false) || false) ||
(object['so_number']?.toLowerCase().contains(lowerQuery) ?? (object['so_number']?.toLowerCase().contains(lowerQuery) ??
false) || false) ||
(object['functional_department']?.toLowerCase().contains( (object['cost_center']?.toLowerCase().contains(
lowerQuery, lowerQuery,
) ?? ) ??
false) || false) ||
@ -759,7 +759,7 @@ class _MISforexState extends State<MISforex>
), ),
DataColumn( DataColumn(
label: Text( label: Text(
'Department', 'Cost Center',
style: style:
GoogleFonts.poppins( GoogleFonts.poppins(
fontSize: 12, fontSize: 12,
@ -882,7 +882,7 @@ class _MISforexState extends State<MISforex>
), ),
DataCell( DataCell(
Text( Text(
'${entry['functional_department']}', '${entry['cost_center']}',
style: style:
GoogleFonts.poppins( GoogleFonts.poppins(
fontSize: fontSize:

View File

@ -421,7 +421,7 @@ class _MIShotelState extends State<MIShotel>
false) || false) ||
(object['so_number']?.toLowerCase().contains(lowerQuery) ?? (object['so_number']?.toLowerCase().contains(lowerQuery) ??
false) || false) ||
(object['functional_department']?.toLowerCase().contains( (object['cost_center']?.toLowerCase().contains(
lowerQuery, lowerQuery,
) ?? ) ??
false) || false) ||
@ -479,7 +479,7 @@ class _MIShotelState extends State<MIShotel>
false) || false) ||
(object['so_number']?.toLowerCase().contains(lowerQuery) ?? (object['so_number']?.toLowerCase().contains(lowerQuery) ??
false) || false) ||
(object['functional_department']?.toLowerCase().contains( (object['cost_center']?.toLowerCase().contains(
lowerQuery, lowerQuery,
) ?? ) ??
false) || false) ||
@ -819,7 +819,7 @@ class _MIShotelState extends State<MIShotel>
// DataColumn(label: Text('Plan Id', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Plan Id', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Employee Code', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Employee Code', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('SO Number', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('SO Number', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Department', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Cost Center', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Flight Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Flight Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Plan Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Plan Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Sector', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Sector', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
@ -829,7 +829,7 @@ class _MIShotelState extends State<MIShotel>
// DataCell(Text('${entry['plan_id']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['plan_id']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['employee_code']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['employee_code']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['so_number']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['so_number']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['functional_department']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['cost_center']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['flight_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['flight_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['plan_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['plan_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['sector']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['sector']}', style: GoogleFonts.poppins(fontSize: 12))),
@ -980,7 +980,7 @@ class _MIShotelState extends State<MIShotel>
), ),
DataColumn( DataColumn(
label: Text( label: Text(
'Department', 'Cost Center',
style: style:
GoogleFonts.poppins( GoogleFonts.poppins(
fontSize: 12, fontSize: 12,
@ -1124,7 +1124,7 @@ class _MIShotelState extends State<MIShotel>
), ),
DataCell( DataCell(
Text( Text(
'${entry['functional_department']}', '${entry['cost_center']}',
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: fontSize:
12, 12,
@ -1357,7 +1357,7 @@ class _MIShotelState extends State<MIShotel>
// DataColumn(label: Text('Plan Id', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Plan Id', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Employee Code', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Employee Code', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('SO Number', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('SO Number', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Department', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Cost Center', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Flight Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Flight Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Plan Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Plan Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Sector', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Sector', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
@ -1367,7 +1367,7 @@ class _MIShotelState extends State<MIShotel>
// DataCell(Text('${entry['plan_id']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['plan_id']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['employee_code']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['employee_code']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['so_number']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['so_number']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['functional_department']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['cost_center']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['flight_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['flight_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['plan_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['plan_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['sector']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['sector']}', style: GoogleFonts.poppins(fontSize: 12))),
@ -1600,7 +1600,7 @@ class _MIShotelState extends State<MIShotel>
), ),
DataColumn( DataColumn(
label: Text( label: Text(
'Department', 'Cost Center',
style: style:
GoogleFonts.poppins( GoogleFonts.poppins(
fontSize: 12, fontSize: 12,
@ -1743,7 +1743,7 @@ class _MIShotelState extends State<MIShotel>
), ),
DataCell( DataCell(
Text( Text(
'${entry['functional_department']}', '${entry['cost_center']}',
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: fontSize:
12, 12,

View File

@ -742,7 +742,7 @@ class _ServicesAnalysisState extends State<ServicesAnalysis>
// DataColumn(label: Text('Plan Id', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Plan Id', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Employee Code', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Employee Code', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('SO Number', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('SO Number', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Department', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Cost Center', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Flight Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Flight Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Plan Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Plan Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Sector', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Sector', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
@ -752,7 +752,7 @@ class _ServicesAnalysisState extends State<ServicesAnalysis>
// DataCell(Text('${entry['plan_id']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['plan_id']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['employee_code']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['employee_code']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['so_number']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['so_number']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['functional_department']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['cost_center']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['flight_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['flight_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['plan_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['plan_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['sector']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['sector']}', style: GoogleFonts.poppins(fontSize: 12))),
@ -1094,7 +1094,7 @@ class _ServicesAnalysisState extends State<ServicesAnalysis>
// DataColumn(label: Text('Plan Id', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Plan Id', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Employee Code', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Employee Code', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('SO Number', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('SO Number', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Department', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Cost Center', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Flight Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Flight Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Plan Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Plan Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
// DataColumn(label: Text('Sector', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Sector', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))),
@ -1104,7 +1104,7 @@ class _ServicesAnalysisState extends State<ServicesAnalysis>
// DataCell(Text('${entry['plan_id']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['plan_id']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['employee_code']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['employee_code']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['so_number']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['so_number']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['functional_department']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['cost_center']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['flight_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['flight_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['plan_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['plan_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))),
// DataCell(Text('${entry['sector']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['sector']}', style: GoogleFonts.poppins(fontSize: 12))),

View File

@ -150,6 +150,8 @@ class _TravelAgentListScreenState extends State<TravelAgentListScreen> {
print("TOEKRWE: $token"); print("TOEKRWE: $token");
if (token == null) { if (token == null) {
print('Token not found. Please log in.');
return [];
throw Exception('Token not found. Please log in.'); throw Exception('Token not found. Please log in.');
} }
@ -165,6 +167,8 @@ class _TravelAgentListScreenState extends State<TravelAgentListScreen> {
final data = json.decode(response.body); final data = json.decode(response.body);
return data['data']; // Returning raw JSON list return data['data']; // Returning raw JSON list
} else { } else {
print('Failed to load users');
return [];
throw Exception('Failed to load users'); throw Exception('Failed to load users');
} }
} }

View File

@ -19,7 +19,7 @@ import '../../routes/custom_drawer.dart';
import '../../services/apiService.dart'; import '../../services/apiService.dart';
import '../../utils/pagination.dart'; import '../../utils/pagination.dart';
import '../../widgets/custom_popup.dart'; import '../../widgets/custom_popup.dart';
import '../../widgets/popup_userList_action.dart'; // import '../../widgets/popup_userList_action.dart';
class UserListScreen extends StatefulWidget { class UserListScreen extends StatefulWidget {
@override @override
@ -1275,12 +1275,40 @@ class _UserListScreenState extends State<UserListScreen> {
), ),
), ),
DataCell( DataCell(
UserActionsMenu( Row(
user: user, mainAxisAlignment:
getUserDetails: MainAxisAlignment.start,
(id) => children: [
apiService.getSingleUser(id), GestureDetector(
child: Tooltip(
message: 'Edit User Details',
child: Image.asset(
'assets/images/IconsImg/edit.png',
width: 20,
height: 15,
),
),
onTap: () async {
// Navigator.pop(context); // Close the menu
// final userId = user['user_id'];
final userId = int.parse(user['user_id'].toString());
final usersData = await apiService.getSingleUser(userId);
context.go("/CreateUserDetails", extra: {
"selectedUser": usersData,
"isViewMode": true,
});
},
),
],
), ),
),
// DataCell(
// UserActionsMenu(
// user: user,
// getUserDetails:
// (id) =>
// apiService.getSingleUser(id),
// ),
// PopupMenuButton<int>( // PopupMenuButton<int>(
// color: Colors.white, // color: Colors.white,
// padding: EdgeInsets.zero, // padding: EdgeInsets.zero,
@ -1456,7 +1484,7 @@ class _UserListScreenState extends State<UserListScreen> {
// // ), // // ),
// ], // ],
// ), // ),
), // ),
], ],
); );
}).toList(), }).toList(),
@ -1498,12 +1526,36 @@ class _UserListScreenState extends State<UserListScreen> {
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
), ),
Row(
UserActionsMenu( mainAxisAlignment:
user: user, MainAxisAlignment.start,
getUserDetails: children: [
(id) => apiService.getSingleUser(id), GestureDetector(
child: Tooltip(
message: 'Edit User Details',
child: Image.asset(
'assets/images/IconsImg/edit.png',
width: 20,
height: 15,
),
),
onTap: () async {
Navigator.pop(context); // Close the menu
final userId = int.parse(user['user_id'].toString());
final usersData = await apiService.getSingleUser(userId);
context.go("/CreateUserDetails", extra: {
"selectedUser": usersData,
"isViewMode": true,
});
},
),
],
), ),
// UserActionsMenu(
// user: user,
// getUserDetails:
// (id) => apiService.getSingleUser(id),
// ),
// PopupMenuButton<int>( // PopupMenuButton<int>(
// color: Colors.white, // color: Colors.white,
// padding: EdgeInsets.zero, // padding: EdgeInsets.zero,

View File

@ -40,25 +40,25 @@ class UserActionsMenu extends StatelessWidget {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
// GestureDetector( GestureDetector(
// child: Tooltip( child: Tooltip(
// message: 'View Details', message: 'View Details',
// child: Icon(Icons.remove_red_eye, child: Icon(Icons.remove_red_eye,
// color: Color(0xFF475569), size: 18) color: Color(0xFF475569), size: 18)
// ), ),
// // child: Icon(Icons.remove_red_eye, // child: Icon(Icons.remove_red_eye,
// // color: Color(0xFF475569), size: 18,), // color: Color(0xFF475569), size: 18,),
// onTap: () async { onTap: () async {
// Navigator.pop(context); // Close the menu Navigator.pop(context); // Close the menu
// final userId = getUserId(user['user_id']); final userId = getUserId(user['user_id']);
// final usersData = await getUserDetails(userId); final usersData = await getUserDetails(userId);
// context.go("/CreateTravelAgent", extra: { context.go("/CreateTravelAgent", extra: {
// "selectedUser": usersData, "selectedUser": usersData,
// "isViewMode": true, "isViewMode": true,
// }); });
// }, },
// ), ),
// SizedBox(width: 8), SizedBox(width: 8),
GestureDetector( GestureDetector(
child: Tooltip( child: Tooltip(
message: 'Edit Details', message: 'Edit Details',

View File

@ -40,25 +40,25 @@ class UserActionsMenu extends StatelessWidget {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
// GestureDetector( GestureDetector(
// child: Tooltip( child: Tooltip(
// message: 'View Details', message: 'View Details',
// child: Icon(Icons.remove_red_eye, child: Icon(Icons.remove_red_eye,
// color: Color(0xFF475569), size: 18) color: Color(0xFF475569), size: 18)
// ), ),
// // child: Icon(Icons.remove_red_eye, // child: Icon(Icons.remove_red_eye,
// // color: Color(0xFF475569), size: 18,), // color: Color(0xFF475569), size: 18,),
// onTap: () async { onTap: () async {
// Navigator.pop(context); // Close the menu Navigator.pop(context); // Close the menu
// final userId = getUserId(user['user_id']); final userId = getUserId(user['user_id']);
// final usersData = await getUserDetails(userId); final usersData = await getUserDetails(userId);
// context.go("/CreateUserDetails", extra: { context.go("/CreateUserDetails", extra: {
// "selectedUser": usersData, "selectedUser": usersData,
// "isViewMode": true, "isViewMode": true,
// }); });
// }, },
// ), ),
// SizedBox(width: 8), SizedBox(width: 8),
GestureDetector( GestureDetector(
child: Tooltip( child: Tooltip(
message: 'Edit Details', message: 'Edit Details',