minor issues fixes 8
This commit is contained in:
parent
57f7f29054
commit
63e51d8c5f
@ -46,6 +46,7 @@ class _ListAllPlansState extends State<ListAllPlans> {
|
||||
List<Plan> allPlans = [];
|
||||
List<Plan> filteredPlans = [];
|
||||
TextEditingController searchController = TextEditingController();
|
||||
late bool _listDialogShown = false;
|
||||
|
||||
@override
|
||||
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) {
|
||||
return ResponsiveBuilder(
|
||||
builder: (context, sizingInfo) {
|
||||
@ -830,7 +934,9 @@ class _ListAllPlansState extends State<ListAllPlans> {
|
||||
),
|
||||
),
|
||||
),
|
||||
DataCell(
|
||||
DataCell(GestureDetector(
|
||||
onTap: () => _showDetails(plan.planId),
|
||||
child:
|
||||
Container(
|
||||
width:
|
||||
double
|
||||
@ -857,7 +963,7 @@ class _ListAllPlansState extends State<ListAllPlans> {
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
),
|
||||
),),
|
||||
),
|
||||
DataCell(
|
||||
Row(
|
||||
@ -1050,7 +1156,9 @@ class _ListAllPlansState extends State<ListAllPlans> {
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
children: [GestureDetector(
|
||||
onTap: () => _showDetails(plan.planId),
|
||||
child:
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 8,
|
||||
@ -1074,7 +1182,7 @@ class _ListAllPlansState extends State<ListAllPlans> {
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
),
|
||||
),),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
|
||||
@ -43,6 +43,9 @@ class _ApprovalListState extends State<ApprovalList> {
|
||||
List<Plan> filteredPlans = [];
|
||||
TextEditingController searchController = TextEditingController();
|
||||
|
||||
late bool _dialogShown = false;
|
||||
Map<String, dynamic> successList = {};
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
@ -374,6 +377,242 @@ class _ApprovalListState extends State<ApprovalList> {
|
||||
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) {
|
||||
return ResponsiveBuilder(
|
||||
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(
|
||||
Container(
|
||||
width:
|
||||
double
|
||||
.infinity, // Set your desired fixed size (equal width and height)
|
||||
height: 25,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
color: getStatusColor(
|
||||
GestureDetector(
|
||||
onTap: () => _showDetails(plan.planId),
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
height: 25,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
color: getStatusColor(plan.statusValue),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Text(
|
||||
plan.statusValue,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(
|
||||
8,
|
||||
),
|
||||
),
|
||||
|
||||
child: Text(
|
||||
plan.statusValue,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: getStatusTextColor(
|
||||
plan.statusValue,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: getStatusTextColor(plan.statusValue),
|
||||
fontSize: 12,
|
||||
fontFamily: "Inter",
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
fontSize: 12,
|
||||
fontFamily: "Inter",
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
DataCell(
|
||||
Row(
|
||||
children: [
|
||||
@ -1145,23 +1407,26 @@ class _ApprovalListState extends State<ApprovalList> {
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 8,
|
||||
vertical: 4,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: getStatusColor(plan.statusValue),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Text(
|
||||
plan.statusValue,
|
||||
style: TextStyle(
|
||||
color: getStatusTextColor(
|
||||
plan.statusValue,
|
||||
GestureDetector(
|
||||
onTap: () => _showDetails(plan.planId),
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 8,
|
||||
vertical: 4,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: getStatusColor(plan.statusValue),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Text(
|
||||
plan.statusValue,
|
||||
style: TextStyle(
|
||||
color: getStatusTextColor(
|
||||
plan.statusValue,
|
||||
),
|
||||
fontSize: 10,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
fontSize: 10,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@ -52,6 +52,7 @@ class _ListPlansState extends State<ListPlans> {
|
||||
String? location;
|
||||
|
||||
late bool _dialogShown = false;
|
||||
late bool _listDialogShown = false;
|
||||
late StreamSubscription<html.PopStateEvent> _popStateListener;
|
||||
|
||||
@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) {
|
||||
return ResponsiveBuilder(
|
||||
builder: (context, sizingInfo) {
|
||||
@ -962,7 +1066,10 @@ class _ListPlansState extends State<ListPlans> {
|
||||
),
|
||||
),
|
||||
DataCell(
|
||||
Container(
|
||||
GestureDetector(
|
||||
onTap: () => _showDetails(plan.planId),
|
||||
child:
|
||||
Container(
|
||||
width:
|
||||
double
|
||||
.infinity, // Set your desired fixed size (equal width and height)
|
||||
@ -1006,7 +1113,7 @@ class _ListPlansState extends State<ListPlans> {
|
||||
fontWeight: FontWeight.w400,
|
||||
),
|
||||
),
|
||||
),
|
||||
),),
|
||||
),
|
||||
DataCell(
|
||||
Row(
|
||||
@ -1242,7 +1349,9 @@ class _ListPlansState extends State<ListPlans> {
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
children: [GestureDetector(
|
||||
onTap: () => _showDetails(plan.planId),
|
||||
child:
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 8,
|
||||
@ -1262,7 +1371,7 @@ class _ListPlansState extends State<ListPlans> {
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
),
|
||||
),),
|
||||
// PlanPopupMenu(
|
||||
// plan: plan,
|
||||
// deletePlan: deletePlan,
|
||||
|
||||
@ -441,7 +441,7 @@ class _AdvancePurchaseState extends State<AdvancePurchase>
|
||||
false) ||
|
||||
(object['so_number']?.toLowerCase().contains(lowerQuery) ??
|
||||
false) ||
|
||||
(object['functional_department']?.toLowerCase().contains(
|
||||
(object['cost_center']?.toLowerCase().contains(
|
||||
lowerQuery,
|
||||
) ??
|
||||
false) ||
|
||||
@ -497,7 +497,7 @@ class _AdvancePurchaseState extends State<AdvancePurchase>
|
||||
false) ||
|
||||
(object['so_number']?.toLowerCase().contains(lowerQuery) ??
|
||||
false) ||
|
||||
(object['functional_department']?.toLowerCase().contains(
|
||||
(object['cost_center']?.toLowerCase().contains(
|
||||
lowerQuery,
|
||||
) ??
|
||||
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('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('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('Plan Trip Type', 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['employee_code']}', 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['plan_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))),
|
||||
// DataCell(Text('${entry['AdvPurch']}', style: GoogleFonts.poppins(fontSize: 12))),
|
||||
@ -985,7 +985,7 @@ class _AdvancePurchaseState extends State<AdvancePurchase>
|
||||
),
|
||||
DataColumn(
|
||||
label: Text(
|
||||
'Department',
|
||||
'Cost Center',
|
||||
style:
|
||||
GoogleFonts.poppins(
|
||||
fontSize: 12,
|
||||
@ -1107,7 +1107,7 @@ class _AdvancePurchaseState extends State<AdvancePurchase>
|
||||
),
|
||||
DataCell(
|
||||
Text(
|
||||
'${entry['functional_department']}',
|
||||
'${entry['cost_center']}',
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize:
|
||||
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('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('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('Plan Trip Type', 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['employee_code']}', 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['plan_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))),
|
||||
// DataCell(Text('${entry['AdvPurch']}', style: GoogleFonts.poppins(fontSize: 12))),
|
||||
@ -1563,7 +1563,7 @@ class _AdvancePurchaseState extends State<AdvancePurchase>
|
||||
),
|
||||
DataColumn(
|
||||
label: Text(
|
||||
'Department',
|
||||
'Cost Center',
|
||||
style:
|
||||
GoogleFonts.poppins(
|
||||
fontSize: 12,
|
||||
@ -1685,7 +1685,7 @@ class _AdvancePurchaseState extends State<AdvancePurchase>
|
||||
),
|
||||
DataCell(
|
||||
Text(
|
||||
'${entry['functional_department']}',
|
||||
'${entry['cost_center']}',
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize:
|
||||
12,
|
||||
|
||||
@ -385,7 +385,7 @@ class _GuestHouseState extends State<GuestHouse>
|
||||
false) ||
|
||||
(object['so_number']?.toLowerCase().contains(lowerQuery) ??
|
||||
false) ||
|
||||
(object['functional_department']?.toLowerCase().contains(
|
||||
(object['cost_center']?.toLowerCase().contains(
|
||||
lowerQuery,
|
||||
) ??
|
||||
false) ||
|
||||
@ -433,7 +433,7 @@ class _GuestHouseState extends State<GuestHouse>
|
||||
false) ||
|
||||
(object['so_number']?.toLowerCase().contains(lowerQuery) ??
|
||||
false) ||
|
||||
(object['functional_department']?.toLowerCase().contains(
|
||||
(object['cost_center']?.toLowerCase().contains(
|
||||
lowerQuery,
|
||||
) ??
|
||||
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('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('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('Plan Trip Type', 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['employee_code']}', 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['plan_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))),
|
||||
// DataCell(Text('${entry['sector']}', style: GoogleFonts.poppins(fontSize: 12))),
|
||||
@ -925,7 +925,7 @@ class _GuestHouseState extends State<GuestHouse>
|
||||
),
|
||||
DataColumn(
|
||||
label: Text(
|
||||
'Department',
|
||||
'Cost Center',
|
||||
style:
|
||||
GoogleFonts.poppins(
|
||||
fontSize: 12,
|
||||
@ -1039,7 +1039,7 @@ class _GuestHouseState extends State<GuestHouse>
|
||||
),
|
||||
DataCell(
|
||||
Text(
|
||||
'${entry['functional_department']}',
|
||||
'${entry['cost_center']}',
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize:
|
||||
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('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('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('Plan Trip Type', 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['employee_code']}', 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['plan_trip_type']}', 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",
|
||||
// "customer_name": "sangeetha E",
|
||||
// "so_number": "12345",
|
||||
// "functional_department": "HR",
|
||||
// "cost_center": "HR",
|
||||
// "flight_trip_type": "Roundtrip",
|
||||
// "plan_trip_type": "international",
|
||||
// "sector": "Rajiv Gandhi International (Hyderabad) - Canadian Rockies Intl (Cranbrook)",
|
||||
@ -1503,7 +1503,7 @@ class _GuestHouseState extends State<GuestHouse>
|
||||
),
|
||||
DataColumn(
|
||||
label: Text(
|
||||
'Department',
|
||||
'Cost Center',
|
||||
style:
|
||||
GoogleFonts.poppins(
|
||||
fontSize: 12,
|
||||
@ -1617,7 +1617,7 @@ class _GuestHouseState extends State<GuestHouse>
|
||||
),
|
||||
DataCell(
|
||||
Text(
|
||||
'${entry['functional_department']}',
|
||||
'${entry['cost_center']}',
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize:
|
||||
12,
|
||||
|
||||
@ -408,7 +408,7 @@ class _MISairState extends State<MISair> with SingleTickerProviderStateMixin {
|
||||
false) ||
|
||||
(object['so_number']?.toLowerCase().contains(lowerQuery) ??
|
||||
false) ||
|
||||
(object['functional_department']?.toLowerCase().contains(
|
||||
(object['cost_center']?.toLowerCase().contains(
|
||||
lowerQuery,
|
||||
) ??
|
||||
false) ||
|
||||
@ -457,7 +457,7 @@ class _MISairState extends State<MISair> with SingleTickerProviderStateMixin {
|
||||
false) ||
|
||||
(object['so_number']?.toLowerCase().contains(lowerQuery) ??
|
||||
false) ||
|
||||
(object['functional_department']?.toLowerCase().contains(
|
||||
(object['cost_center']?.toLowerCase().contains(
|
||||
lowerQuery,
|
||||
) ??
|
||||
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('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('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('Plan Trip Type', 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['employee_code']}', 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['plan_trip_type']}', 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(
|
||||
label: Text(
|
||||
'Department',
|
||||
'Cost Center',
|
||||
style:
|
||||
GoogleFonts.poppins(
|
||||
fontSize: 12,
|
||||
@ -1063,7 +1063,7 @@ class _MISairState extends State<MISair> with SingleTickerProviderStateMixin {
|
||||
),
|
||||
DataCell(
|
||||
Text(
|
||||
'${entry['functional_department']}',
|
||||
'${entry['cost_center']}',
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize:
|
||||
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('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('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('Plan Trip Type', 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['employee_code']}', 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['plan_trip_type']}', 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(
|
||||
label: Text(
|
||||
'Department',
|
||||
'Cost Center',
|
||||
style:
|
||||
GoogleFonts.poppins(
|
||||
fontSize: 12,
|
||||
@ -1583,7 +1583,7 @@ class _MISairState extends State<MISair> with SingleTickerProviderStateMixin {
|
||||
),
|
||||
DataCell(
|
||||
Text(
|
||||
'${entry['functional_department']}',
|
||||
'${entry['cost_center']}',
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize:
|
||||
12,
|
||||
|
||||
@ -367,7 +367,7 @@ class _MISforexState extends State<MISforex>
|
||||
false) ||
|
||||
(object['so_number']?.toLowerCase().contains(lowerQuery) ??
|
||||
false) ||
|
||||
(object['functional_department']?.toLowerCase().contains(
|
||||
(object['cost_center']?.toLowerCase().contains(
|
||||
lowerQuery,
|
||||
) ??
|
||||
false) ||
|
||||
@ -759,7 +759,7 @@ class _MISforexState extends State<MISforex>
|
||||
),
|
||||
DataColumn(
|
||||
label: Text(
|
||||
'Department',
|
||||
'Cost Center',
|
||||
style:
|
||||
GoogleFonts.poppins(
|
||||
fontSize: 12,
|
||||
@ -882,7 +882,7 @@ class _MISforexState extends State<MISforex>
|
||||
),
|
||||
DataCell(
|
||||
Text(
|
||||
'${entry['functional_department']}',
|
||||
'${entry['cost_center']}',
|
||||
style:
|
||||
GoogleFonts.poppins(
|
||||
fontSize:
|
||||
|
||||
@ -421,7 +421,7 @@ class _MIShotelState extends State<MIShotel>
|
||||
false) ||
|
||||
(object['so_number']?.toLowerCase().contains(lowerQuery) ??
|
||||
false) ||
|
||||
(object['functional_department']?.toLowerCase().contains(
|
||||
(object['cost_center']?.toLowerCase().contains(
|
||||
lowerQuery,
|
||||
) ??
|
||||
false) ||
|
||||
@ -479,7 +479,7 @@ class _MIShotelState extends State<MIShotel>
|
||||
false) ||
|
||||
(object['so_number']?.toLowerCase().contains(lowerQuery) ??
|
||||
false) ||
|
||||
(object['functional_department']?.toLowerCase().contains(
|
||||
(object['cost_center']?.toLowerCase().contains(
|
||||
lowerQuery,
|
||||
) ??
|
||||
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('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('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('Plan Trip Type', 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['employee_code']}', 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['plan_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))),
|
||||
// DataCell(Text('${entry['sector']}', style: GoogleFonts.poppins(fontSize: 12))),
|
||||
@ -980,7 +980,7 @@ class _MIShotelState extends State<MIShotel>
|
||||
),
|
||||
DataColumn(
|
||||
label: Text(
|
||||
'Department',
|
||||
'Cost Center',
|
||||
style:
|
||||
GoogleFonts.poppins(
|
||||
fontSize: 12,
|
||||
@ -1124,7 +1124,7 @@ class _MIShotelState extends State<MIShotel>
|
||||
),
|
||||
DataCell(
|
||||
Text(
|
||||
'${entry['functional_department']}',
|
||||
'${entry['cost_center']}',
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize:
|
||||
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('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('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('Plan Trip Type', 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['employee_code']}', 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['plan_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))),
|
||||
// DataCell(Text('${entry['sector']}', style: GoogleFonts.poppins(fontSize: 12))),
|
||||
@ -1600,7 +1600,7 @@ class _MIShotelState extends State<MIShotel>
|
||||
),
|
||||
DataColumn(
|
||||
label: Text(
|
||||
'Department',
|
||||
'Cost Center',
|
||||
style:
|
||||
GoogleFonts.poppins(
|
||||
fontSize: 12,
|
||||
@ -1743,7 +1743,7 @@ class _MIShotelState extends State<MIShotel>
|
||||
),
|
||||
DataCell(
|
||||
Text(
|
||||
'${entry['functional_department']}',
|
||||
'${entry['cost_center']}',
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize:
|
||||
12,
|
||||
|
||||
@ -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('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('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('Plan Trip Type', 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['employee_code']}', 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['plan_trip_type']}', 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('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('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('Plan Trip Type', 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['employee_code']}', 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['plan_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))),
|
||||
// DataCell(Text('${entry['sector']}', style: GoogleFonts.poppins(fontSize: 12))),
|
||||
|
||||
@ -150,6 +150,8 @@ class _TravelAgentListScreenState extends State<TravelAgentListScreen> {
|
||||
print("TOEKRWE: $token");
|
||||
|
||||
if (token == null) {
|
||||
print('Token not found. Please log in.');
|
||||
return [];
|
||||
throw Exception('Token not found. Please log in.');
|
||||
}
|
||||
|
||||
@ -165,6 +167,8 @@ class _TravelAgentListScreenState extends State<TravelAgentListScreen> {
|
||||
final data = json.decode(response.body);
|
||||
return data['data']; // Returning raw JSON list
|
||||
} else {
|
||||
print('Failed to load users');
|
||||
return [];
|
||||
throw Exception('Failed to load users');
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,7 +19,7 @@ import '../../routes/custom_drawer.dart';
|
||||
import '../../services/apiService.dart';
|
||||
import '../../utils/pagination.dart';
|
||||
import '../../widgets/custom_popup.dart';
|
||||
import '../../widgets/popup_userList_action.dart';
|
||||
// import '../../widgets/popup_userList_action.dart';
|
||||
|
||||
class UserListScreen extends StatefulWidget {
|
||||
@override
|
||||
@ -1275,12 +1275,40 @@ class _UserListScreenState extends State<UserListScreen> {
|
||||
),
|
||||
),
|
||||
DataCell(
|
||||
UserActionsMenu(
|
||||
user: user,
|
||||
getUserDetails:
|
||||
(id) =>
|
||||
apiService.getSingleUser(id),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.start,
|
||||
children: [
|
||||
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>(
|
||||
// color: Colors.white,
|
||||
// padding: EdgeInsets.zero,
|
||||
@ -1456,7 +1484,7 @@ class _UserListScreenState extends State<UserListScreen> {
|
||||
// // ),
|
||||
// ],
|
||||
// ),
|
||||
),
|
||||
// ),
|
||||
],
|
||||
);
|
||||
}).toList(),
|
||||
@ -1498,12 +1526,36 @@ class _UserListScreenState extends State<UserListScreen> {
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
|
||||
UserActionsMenu(
|
||||
user: user,
|
||||
getUserDetails:
|
||||
(id) => apiService.getSingleUser(id),
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.start,
|
||||
children: [
|
||||
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>(
|
||||
// color: Colors.white,
|
||||
// padding: EdgeInsets.zero,
|
||||
|
||||
@ -40,25 +40,25 @@ class UserActionsMenu extends StatelessWidget {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
// GestureDetector(
|
||||
// child: Tooltip(
|
||||
// message: 'View Details',
|
||||
// child: Icon(Icons.remove_red_eye,
|
||||
// color: Color(0xFF475569), size: 18)
|
||||
// ),
|
||||
// // child: Icon(Icons.remove_red_eye,
|
||||
// // color: Color(0xFF475569), size: 18,),
|
||||
// onTap: () async {
|
||||
// Navigator.pop(context); // Close the menu
|
||||
// final userId = getUserId(user['user_id']);
|
||||
// final usersData = await getUserDetails(userId);
|
||||
// context.go("/CreateTravelAgent", extra: {
|
||||
// "selectedUser": usersData,
|
||||
// "isViewMode": true,
|
||||
// });
|
||||
// },
|
||||
// ),
|
||||
// SizedBox(width: 8),
|
||||
GestureDetector(
|
||||
child: Tooltip(
|
||||
message: 'View Details',
|
||||
child: Icon(Icons.remove_red_eye,
|
||||
color: Color(0xFF475569), size: 18)
|
||||
),
|
||||
// child: Icon(Icons.remove_red_eye,
|
||||
// color: Color(0xFF475569), size: 18,),
|
||||
onTap: () async {
|
||||
Navigator.pop(context); // Close the menu
|
||||
final userId = getUserId(user['user_id']);
|
||||
final usersData = await getUserDetails(userId);
|
||||
context.go("/CreateTravelAgent", extra: {
|
||||
"selectedUser": usersData,
|
||||
"isViewMode": true,
|
||||
});
|
||||
},
|
||||
),
|
||||
SizedBox(width: 8),
|
||||
GestureDetector(
|
||||
child: Tooltip(
|
||||
message: 'Edit Details',
|
||||
|
||||
@ -40,25 +40,25 @@ class UserActionsMenu extends StatelessWidget {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
// GestureDetector(
|
||||
// child: Tooltip(
|
||||
// message: 'View Details',
|
||||
// child: Icon(Icons.remove_red_eye,
|
||||
// color: Color(0xFF475569), size: 18)
|
||||
// ),
|
||||
// // child: Icon(Icons.remove_red_eye,
|
||||
// // color: Color(0xFF475569), size: 18,),
|
||||
// onTap: () async {
|
||||
// Navigator.pop(context); // Close the menu
|
||||
// final userId = getUserId(user['user_id']);
|
||||
// final usersData = await getUserDetails(userId);
|
||||
// context.go("/CreateUserDetails", extra: {
|
||||
// "selectedUser": usersData,
|
||||
// "isViewMode": true,
|
||||
// });
|
||||
// },
|
||||
// ),
|
||||
// SizedBox(width: 8),
|
||||
GestureDetector(
|
||||
child: Tooltip(
|
||||
message: 'View Details',
|
||||
child: Icon(Icons.remove_red_eye,
|
||||
color: Color(0xFF475569), size: 18)
|
||||
),
|
||||
// child: Icon(Icons.remove_red_eye,
|
||||
// color: Color(0xFF475569), size: 18,),
|
||||
onTap: () async {
|
||||
Navigator.pop(context); // Close the menu
|
||||
final userId = getUserId(user['user_id']);
|
||||
final usersData = await getUserDetails(userId);
|
||||
context.go("/CreateUserDetails", extra: {
|
||||
"selectedUser": usersData,
|
||||
"isViewMode": true,
|
||||
});
|
||||
},
|
||||
),
|
||||
SizedBox(width: 8),
|
||||
GestureDetector(
|
||||
child: Tooltip(
|
||||
message: 'Edit Details',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user