API-SECURITY
This commit is contained in:
parent
6f251973a5
commit
de7491cc6e
@ -221,6 +221,7 @@ class _ListAllPlansState extends State<ListAllPlans> {
|
|||||||
headers: {
|
headers: {
|
||||||
'Authorization': 'Bearer $token', // Add token here
|
'Authorization': 'Bearer $token', // Add token here
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
'app-signature': 'ts-traveltool-2025-signature-123456',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -253,6 +254,7 @@ class _ListAllPlansState extends State<ListAllPlans> {
|
|||||||
headers: {
|
headers: {
|
||||||
'Authorization': 'Bearer $token',
|
'Authorization': 'Bearer $token',
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
'app-signature': 'ts-traveltool-2025-signature-123456',
|
||||||
},
|
},
|
||||||
body: jsonEncode(planData), // Convert map to JSON
|
body: jsonEncode(planData), // Convert map to JSON
|
||||||
);
|
);
|
||||||
@ -308,6 +310,7 @@ class _ListAllPlansState extends State<ListAllPlans> {
|
|||||||
headers: {
|
headers: {
|
||||||
'Authorization': 'Bearer $token',
|
'Authorization': 'Bearer $token',
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
'app-signature': 'ts-traveltool-2025-signature-123456',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -26,21 +26,21 @@ class CommentModalList extends StatefulWidget {
|
|||||||
class _CommentModalListState extends State<CommentModalList> {
|
class _CommentModalListState extends State<CommentModalList> {
|
||||||
late Future<List<Map<String, dynamic>>> _commentsFuture;
|
late Future<List<Map<String, dynamic>>> _commentsFuture;
|
||||||
|
|
||||||
Future<List<Map<String, dynamic>>> fetchComments1() async {
|
// Future<List<Map<String, dynamic>>> fetchComments1() async {
|
||||||
final response = await http.get(
|
// final response = await http.get(
|
||||||
Uri.parse(
|
// Uri.parse(
|
||||||
'$apiUrl/api/plans/getRemarksByPlanId?plan_id=${widget.planId}',
|
// '$apiUrl/api/plans/getRemarksByPlanId?plan_id=${widget.planId}',
|
||||||
),
|
// ),
|
||||||
);
|
// );
|
||||||
|
//
|
||||||
if (response.statusCode == 200) {
|
// if (response.statusCode == 200) {
|
||||||
final jsonData = json.decode(response.body);
|
// final jsonData = json.decode(response.body);
|
||||||
final List<dynamic> dataList = jsonData['data'];
|
// final List<dynamic> dataList = jsonData['data'];
|
||||||
return dataList.cast<Map<String, dynamic>>();
|
// return dataList.cast<Map<String, dynamic>>();
|
||||||
} else {
|
// } else {
|
||||||
throw Exception('Failed to load comments');
|
// throw Exception('Failed to load comments');
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
Future<List<Map<String, dynamic>>> fetchComments() async {
|
Future<List<Map<String, dynamic>>> fetchComments() async {
|
||||||
// final String apiUrldata =
|
// final String apiUrldata =
|
||||||
|
|||||||
@ -180,15 +180,9 @@ class _ApprovalListState extends State<ApprovalList> {
|
|||||||
|
|
||||||
// Fetch API Data
|
// Fetch API Data
|
||||||
Future<List<Plan>> fetchPlans() async {
|
Future<List<Plan>> fetchPlans() async {
|
||||||
// final String apiUrldata = '$apiUrl/api/plans';
|
|
||||||
// final String apiUrldata = '$apiUrl/api/plans?user_id=$userId';
|
|
||||||
// final String apiUrldata = '$apiUrl/api/plans?user_id=$userId';
|
|
||||||
// final String apiUrldata = '$apiUrl/api/plans?org_id=$orgId&user_id=$userId';
|
|
||||||
|
|
||||||
final String apiUrldata =
|
final String apiUrldata =
|
||||||
'$apiUrl/api/plans/findApprovalList?user_id=$userId&org_id=$orgId';
|
'$apiUrl/api/plans/findApprovalList?user_id=$userId&org_id=$orgId';
|
||||||
|
|
||||||
// api/plans?org_id=1&user_id=1
|
|
||||||
// final token = await getToken();
|
// final token = await getToken();
|
||||||
|
|
||||||
if (token == null) {
|
if (token == null) {
|
||||||
@ -380,136 +374,6 @@ 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 {
|
Future<void> _showDetails(id) async {
|
||||||
_dialogShown = true;
|
_dialogShown = true;
|
||||||
final String apiUrldata =
|
final String apiUrldata =
|
||||||
|
|||||||
@ -276,70 +276,6 @@ class _groupState extends State<Group> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Future<void> postGroupData(Map<String, dynamic> groupData) async {
|
|
||||||
// // final String apiUrldata = '$apiUrl/api/groups/create';
|
|
||||||
//
|
|
||||||
// final token = await getToken(); // Fetch token
|
|
||||||
//
|
|
||||||
// print("postGroupData- ${widget.group?['group_id']}");
|
|
||||||
//
|
|
||||||
// if (selectedGroupId == null) {
|
|
||||||
// print("selectedGroupId is null. Cannot proceed.");
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// final int? groupId = int.tryParse(selectedGroupId!);
|
|
||||||
// if (groupId == null) {
|
|
||||||
// print("groupId is invalid. selectedGroupId = $selectedGroupId");
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// final bool isEdit = widget.group != null && widget.group!.isNotEmpty;
|
|
||||||
// print("postGroupData1 - $selectedGroupId");
|
|
||||||
//
|
|
||||||
// // Build correct API URL
|
|
||||||
// final String apiUrlData = isEdit
|
|
||||||
// ? '$apiUrl/api/groups/update/$groupId' // Update API
|
|
||||||
// : '$apiUrl/api/groups/create';
|
|
||||||
//
|
|
||||||
// if (token == null) {
|
|
||||||
// throw Exception('Token not found. Please log in.');
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// try {
|
|
||||||
// final response = await (isEdit
|
|
||||||
// ? http.put(
|
|
||||||
// // <-- Use PUT for update
|
|
||||||
// Uri.parse(apiUrlData),
|
|
||||||
// headers: {
|
|
||||||
// 'Authorization': 'Bearer $token',
|
|
||||||
// 'Content-Type': 'application/json',
|
|
||||||
// },
|
|
||||||
// body: jsonEncode(groupData),
|
|
||||||
// )
|
|
||||||
// : http.post(
|
|
||||||
// Uri.parse(apiUrlData),
|
|
||||||
// headers: {
|
|
||||||
// 'Authorization': 'Bearer $token',
|
|
||||||
// 'Content-Type': 'application/json',
|
|
||||||
// },
|
|
||||||
// body: jsonEncode(groupData), // Convert map to JSON
|
|
||||||
// ));
|
|
||||||
//
|
|
||||||
// if (response.statusCode == 200 || response.statusCode == 201) {
|
|
||||||
// print("Plan submitted successfully!");
|
|
||||||
// print("Response: ${response.body}");
|
|
||||||
//
|
|
||||||
// context.go('/group');
|
|
||||||
// } else {
|
|
||||||
// print("Failed to submit plan. Status: ${response.statusCode}");
|
|
||||||
// print("Error: ${response.body}");
|
|
||||||
// }
|
|
||||||
// } catch (e) {
|
|
||||||
// print(" Error submitting plan: $e");
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ResponsiveBuilder(
|
return ResponsiveBuilder(
|
||||||
|
|||||||
@ -41,11 +41,13 @@ class _GroupListBackUpState extends State<GroupListBackUp> {
|
|||||||
String? bodyStringColor = await getBodyColor();
|
String? bodyStringColor = await getBodyColor();
|
||||||
|
|
||||||
setState(() {
|
setState(() {
|
||||||
layoutColor = layoutString != null
|
layoutColor =
|
||||||
|
layoutString != null
|
||||||
? Color(int.parse(layoutString))
|
? Color(int.parse(layoutString))
|
||||||
: Colors.redAccent;
|
: Colors.redAccent;
|
||||||
|
|
||||||
bodyColor = bodyStringColor != null
|
bodyColor =
|
||||||
|
bodyStringColor != null
|
||||||
? Color(int.parse(bodyStringColor))
|
? Color(int.parse(bodyStringColor))
|
||||||
: Colors.white;
|
: Colors.white;
|
||||||
});
|
});
|
||||||
@ -90,9 +92,10 @@ class _GroupListBackUpState extends State<GroupListBackUp> {
|
|||||||
headers: {
|
headers: {
|
||||||
'Authorization': 'Bearer $token',
|
'Authorization': 'Bearer $token',
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
'app-signature': 'ts-traveltool-2025-signature-123456',
|
||||||
},
|
},
|
||||||
body: jsonEncode({
|
body: jsonEncode({
|
||||||
"is_active": newStatus // Set new status dynamically
|
"is_active": newStatus, // Set new status dynamically
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -133,8 +136,10 @@ class _GroupListBackUpState extends State<GroupListBackUp> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ResponsiveBuilder(builder: (context, sizingInfo) {
|
return ResponsiveBuilder(
|
||||||
bool isDesktop = sizingInfo.deviceScreenType == DeviceScreenType.desktop;
|
builder: (context, sizingInfo) {
|
||||||
|
bool isDesktop =
|
||||||
|
sizingInfo.deviceScreenType == DeviceScreenType.desktop;
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
// backgroundColor: Colors.white,
|
// backgroundColor: Colors.white,
|
||||||
@ -142,23 +147,27 @@ class _GroupListBackUpState extends State<GroupListBackUp> {
|
|||||||
appBar: CustomAppBar(isDesktop: isDesktop),
|
appBar: CustomAppBar(isDesktop: isDesktop),
|
||||||
drawer: CustomDrawer(isDesktop: false),
|
drawer: CustomDrawer(isDesktop: false),
|
||||||
body: Padding(
|
body: Padding(
|
||||||
padding: isDesktop
|
padding:
|
||||||
|
isDesktop
|
||||||
? EdgeInsets.symmetric(
|
? EdgeInsets.symmetric(
|
||||||
horizontal: MediaQuery.of(context).size.width *
|
horizontal:
|
||||||
|
MediaQuery.of(context).size.width *
|
||||||
0.1, // 30% of screen width as horizontal padding
|
0.1, // 30% of screen width as horizontal padding
|
||||||
vertical: MediaQuery.of(context).size.height *
|
vertical:
|
||||||
|
MediaQuery.of(context).size.height *
|
||||||
0, // 5% of screen height as vertical padding
|
0, // 5% of screen height as vertical padding
|
||||||
)
|
)
|
||||||
: EdgeInsets.all(8),
|
: EdgeInsets.all(8),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
// if (isDesktop) CustomDrawer(isDesktop: true),
|
// if (isDesktop) CustomDrawer(isDesktop: true),
|
||||||
Expanded(child: buildGroupListLayout(isDesktop))
|
Expanded(child: buildGroupListLayout(isDesktop)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
});
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget buildGroupListLayout(bool isDesktop) {
|
Widget buildGroupListLayout(bool isDesktop) {
|
||||||
@ -192,7 +201,8 @@ class _GroupListBackUpState extends State<GroupListBackUp> {
|
|||||||
// ? EdgeInsets.all(10.0)
|
// ? EdgeInsets.all(10.0)
|
||||||
// : EdgeInsets.only(left: 20.0, bottom: 20.0, top: 10.0, right: 20.0),
|
// : EdgeInsets.only(left: 20.0, bottom: 20.0, top: 10.0, right: 20.0),
|
||||||
// padding: const EdgeInsets.all(10),
|
// padding: const EdgeInsets.all(10),
|
||||||
height: isDesktop
|
height:
|
||||||
|
isDesktop
|
||||||
? MediaQuery.of(context).size.height * 0.98
|
? MediaQuery.of(context).size.height * 0.98
|
||||||
: MediaQuery.of(context).size.height,
|
: MediaQuery.of(context).size.height,
|
||||||
// decoration: BoxDecoration(
|
// decoration: BoxDecoration(
|
||||||
@ -244,34 +254,26 @@ class _GroupListBackUpState extends State<GroupListBackUp> {
|
|||||||
// context.go('/CreateGroup');
|
// context.go('/CreateGroup');
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => GroupData(
|
builder:
|
||||||
|
(context) => GroupData(
|
||||||
isDesktop: isDesktop,
|
isDesktop: isDesktop,
|
||||||
groupId: null,
|
groupId: null,
|
||||||
layoutColor: layoutColor!,
|
layoutColor: layoutColor!,
|
||||||
fetchGetGroup: refreshData
|
fetchGetGroup: refreshData,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Text('New Group', style: GoogleFonts.poppins(fontSize: 12)),
|
Text('New Group', style: GoogleFonts.poppins(fontSize: 12)),
|
||||||
SizedBox(
|
SizedBox(width: 5),
|
||||||
width: 5,
|
Icon(Icons.add_circle_outline_rounded, color: Colors.white),
|
||||||
),
|
|
||||||
Icon(
|
|
||||||
Icons.add_circle_outline_rounded,
|
|
||||||
color: Colors.white,
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(height: 5),
|
||||||
height: 5,
|
|
||||||
),
|
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
@ -283,16 +285,12 @@ class _GroupListBackUpState extends State<GroupListBackUp> {
|
|||||||
// color: Colors.red.shade100,
|
// color: Colors.red.shade100,
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
scrollDirection: Axis.vertical,
|
scrollDirection: Axis.vertical,
|
||||||
child: Column(
|
child: Column(children: [buildGroupListView(isDesktop)]),
|
||||||
children: [
|
|
||||||
buildGroupListView(isDesktop),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -322,24 +320,40 @@ class _GroupListBackUpState extends State<GroupListBackUp> {
|
|||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text("Group Name",
|
child: Text(
|
||||||
|
"Group Name",
|
||||||
style: GoogleFonts.poppins(
|
style: GoogleFonts.poppins(
|
||||||
fontSize: 11.5, fontWeight: FontWeight.w400)),
|
fontSize: 11.5,
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text("Domestic Policy",
|
child: Text(
|
||||||
|
"Domestic Policy",
|
||||||
style: GoogleFonts.poppins(
|
style: GoogleFonts.poppins(
|
||||||
fontSize: 11.5, fontWeight: FontWeight.w400)),
|
fontSize: 11.5,
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text("International Policy",
|
child: Text(
|
||||||
|
"International Policy",
|
||||||
style: GoogleFonts.poppins(
|
style: GoogleFonts.poppins(
|
||||||
fontSize: 11.5, fontWeight: FontWeight.w400)),
|
fontSize: 11.5,
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text("Description",
|
child: Text(
|
||||||
|
"Description",
|
||||||
style: GoogleFonts.poppins(
|
style: GoogleFonts.poppins(
|
||||||
fontSize: 11.5, fontWeight: FontWeight.w400)),
|
fontSize: 11.5,
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -348,23 +362,41 @@ class _GroupListBackUpState extends State<GroupListBackUp> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text("${group['name']}",
|
child: Text(
|
||||||
|
"${group['name']}",
|
||||||
style: GoogleFonts.poppins(
|
style: GoogleFonts.poppins(
|
||||||
fontSize: 13, fontWeight: FontWeight.w600)),
|
fontSize: 13,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text("${group['domestic_policy_name'] ?? 'N/A'}",
|
child: Text(
|
||||||
|
"${group['domestic_policy_name'] ?? 'N/A'}",
|
||||||
style: GoogleFonts.poppins(
|
style: GoogleFonts.poppins(
|
||||||
fontSize: 13, fontWeight: FontWeight.w600)),
|
fontSize: 13,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text("${group['international_policy_name']}",
|
child: Text(
|
||||||
|
"${group['international_policy_name']}",
|
||||||
style: GoogleFonts.poppins(
|
style: GoogleFonts.poppins(
|
||||||
fontSize: 13, fontWeight: FontWeight.w600))),
|
fontSize: 13,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text("${group['description'] ?? 'N/A'}",
|
child: Text(
|
||||||
|
"${group['description'] ?? 'N/A'}",
|
||||||
style: GoogleFonts.poppins(
|
style: GoogleFonts.poppins(
|
||||||
fontSize: 13, fontWeight: FontWeight.w600))),
|
fontSize: 13,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
@ -374,20 +406,22 @@ class _GroupListBackUpState extends State<GroupListBackUp> {
|
|||||||
onTap: () async {
|
onTap: () async {
|
||||||
if (group['group_id'] != null) {
|
if (group['group_id'] != null) {
|
||||||
final newGroupID = int.tryParse(
|
final newGroupID = int.tryParse(
|
||||||
group['group_id'].toString());
|
group['group_id'].toString(),
|
||||||
|
);
|
||||||
if (newGroupID != null) {
|
if (newGroupID != null) {
|
||||||
final data = await apiService.getGroupDetailsFind(
|
final data = await apiService.getGroupDetailsFind(
|
||||||
newGroupID); // ✅ Always an int
|
newGroupID,
|
||||||
|
); // ✅ Always an int
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) =>
|
builder:
|
||||||
GroupData(
|
(context) => GroupData(
|
||||||
isDesktop: isDesktop,
|
isDesktop: isDesktop,
|
||||||
groupId: newGroupID,
|
groupId: newGroupID,
|
||||||
// Pass the ID
|
// Pass the ID
|
||||||
groupData: data,
|
groupData: data,
|
||||||
layoutColor: layoutColor!,
|
layoutColor: layoutColor!,
|
||||||
fetchGetGroup: refreshData
|
fetchGetGroup: refreshData,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -399,12 +433,13 @@ class _GroupListBackUpState extends State<GroupListBackUp> {
|
|||||||
// onTap: () {
|
// onTap: () {
|
||||||
// context.go("/CreateGroup", extra: group);
|
// context.go("/CreateGroup", extra: group);
|
||||||
// },
|
// },
|
||||||
child: Image.asset('assets/images/IconsImg/edit.png',
|
child: Image.asset(
|
||||||
width: 20, height: 15),
|
'assets/images/IconsImg/edit.png',
|
||||||
|
width: 20,
|
||||||
|
height: 15,
|
||||||
),
|
),
|
||||||
SizedBox(
|
|
||||||
width: 5,
|
|
||||||
),
|
),
|
||||||
|
SizedBox(width: 5),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
final idStr = group['group_id'];
|
final idStr = group['group_id'];
|
||||||
@ -418,8 +453,11 @@ class _GroupListBackUpState extends State<GroupListBackUp> {
|
|||||||
// print("GroupId : ${group['group_id']} ");
|
// print("GroupId : ${group['group_id']} ");
|
||||||
deleteGroup(group, id, status);
|
deleteGroup(group, id, status);
|
||||||
},
|
},
|
||||||
child: Image.asset('assets/images/IconsImg/delete.png',
|
child: Image.asset(
|
||||||
width: 20, height: 15),
|
'assets/images/IconsImg/delete.png',
|
||||||
|
width: 20,
|
||||||
|
height: 15,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@ -66,7 +66,6 @@ class TemplateState extends State<Template> {
|
|||||||
Map<String, bool> focusStates = {};
|
Map<String, bool> focusStates = {};
|
||||||
bool isDisable = false;
|
bool isDisable = false;
|
||||||
|
|
||||||
|
|
||||||
late QuillController _controller = QuillController.basic();
|
late QuillController _controller = QuillController.basic();
|
||||||
final FocusNode _focusNode = FocusNode();
|
final FocusNode _focusNode = FocusNode();
|
||||||
|
|
||||||
@ -166,6 +165,7 @@ class TemplateState extends State<Template> {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void loadinitializeData() async {
|
void loadinitializeData() async {
|
||||||
orgId = await getOrgId();
|
orgId = await getOrgId();
|
||||||
userId = await getUserId();
|
userId = await getUserId();
|
||||||
@ -475,6 +475,7 @@ class TemplateState extends State<Template> {
|
|||||||
headers: {
|
headers: {
|
||||||
'Authorization': 'Bearer $token',
|
'Authorization': 'Bearer $token',
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
'app-signature': 'ts-traveltool-2025-signature-123456',
|
||||||
},
|
},
|
||||||
body: jsonEncode(policyData), // Convert map to JSON
|
body: jsonEncode(policyData), // Convert map to JSON
|
||||||
);
|
);
|
||||||
@ -483,18 +484,21 @@ class TemplateState extends State<Template> {
|
|||||||
print("policyData submitted successfully!");
|
print("policyData submitted successfully!");
|
||||||
print("Response: ${response.body}");
|
print("Response: ${response.body}");
|
||||||
setState(() {
|
setState(() {
|
||||||
isDisable = false; });
|
isDisable = false;
|
||||||
|
});
|
||||||
context.go('/templateList');
|
context.go('/templateList');
|
||||||
} else {
|
} else {
|
||||||
print("Failed to submit policyData. Status: ${response.statusCode}");
|
print("Failed to submit policyData. Status: ${response.statusCode}");
|
||||||
print("Error: ${response.body}");
|
print("Error: ${response.body}");
|
||||||
setState(() {
|
setState(() {
|
||||||
isDisable = false; });
|
isDisable = false;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print(" Error submitting policyData: $e");
|
print(" Error submitting policyData: $e");
|
||||||
setState(() {
|
setState(() {
|
||||||
isDisable = false; });
|
isDisable = false;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -575,18 +579,16 @@ class TemplateState extends State<Template> {
|
|||||||
tooltip: 'Go To Organization Settings',
|
tooltip: 'Go To Organization Settings',
|
||||||
onTap: (context) {
|
onTap: (context) {
|
||||||
context.go("/OrganizationSettings");
|
context.go("/OrganizationSettings");
|
||||||
}
|
},
|
||||||
),
|
),
|
||||||
BreadcrumbItem(
|
BreadcrumbItem(
|
||||||
title: 'Templates',
|
title: 'Templates',
|
||||||
tooltip: 'Go To Templates',
|
tooltip: 'Go To Templates',
|
||||||
onTap: (context) {
|
onTap: (context) {
|
||||||
context.go("/templateList");
|
context.go("/templateList");
|
||||||
}
|
},
|
||||||
),
|
|
||||||
BreadcrumbItem(
|
|
||||||
title: formatTemplateName(templateName),
|
|
||||||
),
|
),
|
||||||
|
BreadcrumbItem(title: formatTemplateName(templateName)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -771,7 +773,8 @@ class TemplateState extends State<Template> {
|
|||||||
SizedBox(width: 10),
|
SizedBox(width: 10),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
onPressed: isDisable
|
onPressed:
|
||||||
|
isDisable
|
||||||
? null
|
? null
|
||||||
: () async {
|
: () async {
|
||||||
setState(() {
|
setState(() {
|
||||||
|
|||||||
@ -451,7 +451,10 @@ class TemplateForexState extends State<TemplateForex> {
|
|||||||
|
|
||||||
final response = await http.get(
|
final response = await http.get(
|
||||||
uri,
|
uri,
|
||||||
headers: {'Authorization': 'Bearer $token'},
|
headers: {
|
||||||
|
'Authorization': 'Bearer $token',
|
||||||
|
'app-signature': 'ts-traveltool-2025-signature-123456',
|
||||||
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
@ -589,6 +592,7 @@ class TemplateForexState extends State<TemplateForex> {
|
|||||||
|
|
||||||
// Add auth header
|
// Add auth header
|
||||||
request.headers['Authorization'] = 'Bearer $token';
|
request.headers['Authorization'] = 'Bearer $token';
|
||||||
|
request.headers['app-signature'] = 'ts-traveltool-2025-signature-123456';
|
||||||
|
|
||||||
// Add the image as multipart with the key "signature"
|
// Add the image as multipart with the key "signature"
|
||||||
request.files.add(
|
request.files.add(
|
||||||
|
|||||||
@ -12,9 +12,9 @@ import 'package:flutter_quill/quill_delta.dart' as quill;
|
|||||||
import 'package:flutter_quill_delta_from_html/flutter_quill_delta_from_html.dart';
|
import 'package:flutter_quill_delta_from_html/flutter_quill_delta_from_html.dart';
|
||||||
import 'package:flutter_quill_extensions/flutter_quill_extensions.dart';
|
import 'package:flutter_quill_extensions/flutter_quill_extensions.dart';
|
||||||
import 'package:frontend/Screens/myTemplates/templateForex.dart'
|
import 'package:frontend/Screens/myTemplates/templateForex.dart'
|
||||||
as _editorFocusNode;
|
as _editorFocusNode;
|
||||||
import 'package:frontend/Screens/myTemplates/templateForex.dart'
|
import 'package:frontend/Screens/myTemplates/templateForex.dart'
|
||||||
as _editorScrollController;
|
as _editorScrollController;
|
||||||
import 'package:frontend/Screens/myTemplates/templateForex.dart' as _controller;
|
import 'package:frontend/Screens/myTemplates/templateForex.dart' as _controller;
|
||||||
import 'package:html2md/html2md.dart' as html2md;
|
import 'package:html2md/html2md.dart' as html2md;
|
||||||
import 'package:http_parser/http_parser.dart';
|
import 'package:http_parser/http_parser.dart';
|
||||||
@ -451,7 +451,10 @@ class TemplateForexState extends State<TemplateForex> {
|
|||||||
|
|
||||||
final response = await http.get(
|
final response = await http.get(
|
||||||
uri,
|
uri,
|
||||||
headers: {'Authorization': 'Bearer $token'},
|
headers: {
|
||||||
|
'Authorization': 'Bearer $token',
|
||||||
|
'app-signature': 'ts-traveltool-2025-signature-123456',
|
||||||
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
@ -522,7 +525,7 @@ class TemplateForexState extends State<TemplateForex> {
|
|||||||
headers: {
|
headers: {
|
||||||
'Authorization': 'Bearer $token',
|
'Authorization': 'Bearer $token',
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
// 'app-signature': 'ts-traveltool-2025-signature-123456',
|
'app-signature': 'ts-traveltool-2025-signature-123456',
|
||||||
},
|
},
|
||||||
body: jsonEncode(policyData), // Convert map to JSON
|
body: jsonEncode(policyData), // Convert map to JSON
|
||||||
);
|
);
|
||||||
@ -589,6 +592,7 @@ class TemplateForexState extends State<TemplateForex> {
|
|||||||
|
|
||||||
// Add auth header
|
// Add auth header
|
||||||
request.headers['Authorization'] = 'Bearer $token';
|
request.headers['Authorization'] = 'Bearer $token';
|
||||||
|
request.headers['app-signature'] = 'ts-traveltool-2025-signature-123456';
|
||||||
|
|
||||||
// Add the image as multipart with the key "signature"
|
// Add the image as multipart with the key "signature"
|
||||||
request.files.add(
|
request.files.add(
|
||||||
|
|||||||
@ -153,8 +153,6 @@ class _MailSettingState extends State<MailSetting> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> sendTestMail(Map<String, dynamic> mailData) async {
|
Future<void> sendTestMail(Map<String, dynamic> mailData) async {
|
||||||
// final String apiUrldata = '$apiUrl/api/groups/create';
|
|
||||||
|
|
||||||
final token = await getToken(); // Fetch token
|
final token = await getToken(); // Fetch token
|
||||||
|
|
||||||
// Build correct API URL
|
// Build correct API URL
|
||||||
|
|||||||
@ -278,9 +278,6 @@ class ForexDataState extends State<ForexData> {
|
|||||||
|
|
||||||
print("Remarks Data - remarksData");
|
print("Remarks Data - remarksData");
|
||||||
|
|
||||||
// final String apiUrldata = '$apiUrl/api/createForexPerdiem';
|
|
||||||
// api/updateForexPerdiem/39
|
|
||||||
|
|
||||||
final token = await getToken(); // Fetch token
|
final token = await getToken(); // Fetch token
|
||||||
|
|
||||||
if (token == null) {
|
if (token == null) {
|
||||||
|
|||||||
@ -249,6 +249,7 @@ class ForexDataListState extends State<ForexDataList> {
|
|||||||
// Use MultipartRequest (POST only)
|
// Use MultipartRequest (POST only)
|
||||||
final request = http.MultipartRequest('POST', uri);
|
final request = http.MultipartRequest('POST', uri);
|
||||||
request.headers['Authorization'] = 'Bearer $token';
|
request.headers['Authorization'] = 'Bearer $token';
|
||||||
|
request.headers['app-signature'] = 'ts-traveltool-2025-signature-123456';
|
||||||
|
|
||||||
// If updating, spoof the method Laravel-style
|
// If updating, spoof the method Laravel-style
|
||||||
|
|
||||||
@ -310,29 +311,6 @@ class ForexDataListState extends State<ForexDataList> {
|
|||||||
print("STatus 1 - $newStatus");
|
print("STatus 1 - $newStatus");
|
||||||
|
|
||||||
createUserData(userData, userId, newStatus);
|
createUserData(userData, userId, newStatus);
|
||||||
|
|
||||||
// try {
|
|
||||||
// final response = await http.put(
|
|
||||||
// Uri.parse(apiUrlData),
|
|
||||||
// headers: {
|
|
||||||
// 'Authorization': 'Bearer $token',
|
|
||||||
// 'Content-Type': 'application/json',
|
|
||||||
// },
|
|
||||||
// body: jsonEncode({
|
|
||||||
// "is_active": newStatus // Set new status dynamically
|
|
||||||
// }),
|
|
||||||
// );
|
|
||||||
//
|
|
||||||
// if (response.statusCode == 200) {
|
|
||||||
// print("User status updated successfully to $newStatus!");
|
|
||||||
// refreshUserList(); // Refresh users list after update
|
|
||||||
// } else {
|
|
||||||
// print("Failed to update user status. Status: ${response.statusCode}");
|
|
||||||
// print("Error: ${response.body}");
|
|
||||||
// }
|
|
||||||
// } catch (e) {
|
|
||||||
// print("Error updating user status: $e");
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Refresh user list after update
|
// Refresh user list after update
|
||||||
|
|||||||
@ -283,13 +283,7 @@ class _ListPlansState extends State<ListPlans> {
|
|||||||
|
|
||||||
// Fetch API Data
|
// Fetch API Data
|
||||||
Future<List<Plan>> fetchPlans() async {
|
Future<List<Plan>> fetchPlans() async {
|
||||||
// return [];
|
|
||||||
// final String apiUrldata = '$apiUrl/api/plans';
|
|
||||||
// final String apiUrldata = '$apiUrl/api/plans?user_id=$userId';
|
|
||||||
// final String apiUrldata = '$apiUrl/api/plans?user_id=$userId';
|
|
||||||
final String apiUrldata = '$apiUrl/api/plans?org_id=$orgId&user_id=$userId';
|
final String apiUrldata = '$apiUrl/api/plans?org_id=$orgId&user_id=$userId';
|
||||||
// api/plans?org_id=1&user_id=1
|
|
||||||
// final token = await getToken();
|
|
||||||
|
|
||||||
if (token == null) {
|
if (token == null) {
|
||||||
throw Exception('Token not found. Please log in.');
|
throw Exception('Token not found. Please log in.');
|
||||||
@ -351,44 +345,6 @@ class _ListPlansState extends State<ListPlans> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Future<Map<String, dynamic>> getViewPlan(String planId) async {
|
|
||||||
// final String apiUrldata = '$apiUrl/api/plans/find/$planId';
|
|
||||||
// print("API URL: $apiUrldata");
|
|
||||||
// // final token = await getToken();
|
|
||||||
//
|
|
||||||
// if (token == null) {
|
|
||||||
// throw Exception('Token not found. Please log in.');
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// final response = await http.put(
|
|
||||||
// Uri.parse(apiUrldata),
|
|
||||||
// headers: {
|
|
||||||
// 'Authorization': 'Bearer $token', // Add token here
|
|
||||||
// 'Content-Type': 'application/json',
|
|
||||||
// },
|
|
||||||
// );
|
|
||||||
//
|
|
||||||
// if (response.statusCode == 200) {
|
|
||||||
// final Map<String, dynamic>? resData = json.decode(response.body);
|
|
||||||
//
|
|
||||||
// return resData?["data"];
|
|
||||||
// } else {
|
|
||||||
// throw Exception('Failed to load plans');
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// void viewPlan(String planId, {bool isViewMode = false}) async {
|
|
||||||
// try {
|
|
||||||
// Map<String, dynamic> planData = await getViewPlan(planId);
|
|
||||||
// print("ViewAAA - $planData");
|
|
||||||
//
|
|
||||||
// context.go('/createPlan',
|
|
||||||
// extra: {'planData': planData, 'isViewMode': isViewMode});
|
|
||||||
// } catch (e) {
|
|
||||||
// print("Error fetching plan: $e");
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
void deletePlan(String planId) async {
|
void deletePlan(String planId) async {
|
||||||
// try {
|
// try {
|
||||||
// Map<String, dynamic> planData = await ApiService.getViewPlan(planId);
|
// Map<String, dynamic> planData = await ApiService.getViewPlan(planId);
|
||||||
|
|||||||
@ -412,51 +412,6 @@ class PolicyCriteriaState extends State<PolicyCriteria> {
|
|||||||
print("📋 policyData - $policyData");
|
print("📋 policyData - $policyData");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Future<void> fetchTrainFlightClass(int tripId) async {
|
|
||||||
// // final String apiUrldata = '$apiUrl/api/getDropdownMaster';
|
|
||||||
//
|
|
||||||
// // final String apiUrldata =
|
|
||||||
// // '$apiUrl/api/getFlightAndTrainClass?user_id=${widget.userId}&trip_type=tripId';
|
|
||||||
// final String apiUrldata = await apiService.fetchMasterDropdown();
|
|
||||||
//
|
|
||||||
// final token = await getToken();
|
|
||||||
//
|
|
||||||
// if (token == null) {
|
|
||||||
// throw Exception('Token not found. Please log in.');
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// final response = await http.get(
|
|
||||||
// Uri.parse(apiUrldata),
|
|
||||||
// headers: {
|
|
||||||
// 'Authorization': 'Bearer $token',
|
|
||||||
// 'Content-Type': 'application/json',
|
|
||||||
// },
|
|
||||||
// );
|
|
||||||
//
|
|
||||||
// if (response.statusCode == 200) {
|
|
||||||
// try {
|
|
||||||
// final data = json.decode(response.body);
|
|
||||||
// print(data);
|
|
||||||
//
|
|
||||||
// if (!data.containsKey('data') || data['data'] is! Map) {
|
|
||||||
// throw Exception(
|
|
||||||
// "Invalid response format: 'data' field is missing or not a Map");
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// Map<String, dynamic> plansJson =
|
|
||||||
// data['data']; // 'data' is a Map, not a List
|
|
||||||
// setState(() {
|
|
||||||
// apiDataForClass = plansJson; // Store API response in state
|
|
||||||
// isLoading = false;
|
|
||||||
// });
|
|
||||||
// } catch (e) {
|
|
||||||
// throw Exception('Error parsing response: $e');
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// throw Exception('Failed to load plans');
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
Future<void> fetchTrainFlightClass() async {
|
Future<void> fetchTrainFlightClass() async {
|
||||||
print("ftech api");
|
print("ftech api");
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -112,35 +112,6 @@ class _TravelAgentListScreenState extends State<TravelAgentListScreen> {
|
|||||||
return prefs.getString('auth_token');
|
return prefs.getString('auth_token');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Future<List<dynamic>> fetchSingleUsers(userId) async {
|
|
||||||
// orgId = await getOrgId();
|
|
||||||
// final String apiUrlData = '$apiUrl/api/users/find/$userId';
|
|
||||||
//
|
|
||||||
// final String? token = await getToken();
|
|
||||||
//
|
|
||||||
// print("Fetch Users");
|
|
||||||
// print("TOEKRWE: $token");
|
|
||||||
//
|
|
||||||
// if (token == null) {
|
|
||||||
// throw Exception('Token not found. Please log in.');
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// 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);
|
|
||||||
// return data['data']; // Returning raw JSON list
|
|
||||||
// } else {
|
|
||||||
// throw Exception('Failed to load users');
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
Future<List<dynamic>> fetchUsers() async {
|
Future<List<dynamic>> fetchUsers() async {
|
||||||
// return [];
|
// return [];
|
||||||
orgId = await getOrgId();
|
orgId = await getOrgId();
|
||||||
@ -162,6 +133,7 @@ class _TravelAgentListScreenState extends State<TravelAgentListScreen> {
|
|||||||
headers: {
|
headers: {
|
||||||
'Authorization': 'Bearer $token',
|
'Authorization': 'Bearer $token',
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
'app-signature': 'ts-traveltool-2025-signature-123456',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -189,6 +161,7 @@ class _TravelAgentListScreenState extends State<TravelAgentListScreen> {
|
|||||||
headers: {
|
headers: {
|
||||||
'Authorization': 'Bearer $token',
|
'Authorization': 'Bearer $token',
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
'app-signature': 'ts-traveltool-2025-signature-123456',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -243,6 +216,7 @@ class _TravelAgentListScreenState extends State<TravelAgentListScreen> {
|
|||||||
// Use MultipartRequest (POST only)
|
// Use MultipartRequest (POST only)
|
||||||
final request = http.MultipartRequest('POST', uri);
|
final request = http.MultipartRequest('POST', uri);
|
||||||
request.headers['Authorization'] = 'Bearer $token';
|
request.headers['Authorization'] = 'Bearer $token';
|
||||||
|
request.headers['app-signature'] = 'ts-traveltool-2025-signature-123456';
|
||||||
|
|
||||||
// If updating, spoof the method Laravel-style
|
// If updating, spoof the method Laravel-style
|
||||||
|
|
||||||
|
|||||||
@ -114,35 +114,6 @@ class _UserListScreenState extends State<UserListScreen> {
|
|||||||
return prefs.getString('auth_token');
|
return prefs.getString('auth_token');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Future<List<dynamic>> fetchSingleUsers(userId) async {
|
|
||||||
// orgId = await getOrgId();
|
|
||||||
// final String apiUrlData = '$apiUrl/api/users/find/$userId';
|
|
||||||
//
|
|
||||||
// final String? token = await getToken();
|
|
||||||
//
|
|
||||||
// print("Fetch Users");
|
|
||||||
// print("TOEKRWE: $token");
|
|
||||||
//
|
|
||||||
// if (token == null) {
|
|
||||||
// throw Exception('Token not found. Please log in.');
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// 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);
|
|
||||||
// return data['data']; // Returning raw JSON list
|
|
||||||
// } else {
|
|
||||||
// throw Exception('Failed to load users');
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
Future<List<dynamic>> fetchUsers() async {
|
Future<List<dynamic>> fetchUsers() async {
|
||||||
// return [];
|
// return [];
|
||||||
orgId = await getOrgId();
|
orgId = await getOrgId();
|
||||||
|
|||||||
@ -5,13 +5,14 @@
|
|||||||
* File : web/index.html - change below
|
* File : web/index.html - change below
|
||||||
* <base href="/adfactor/"> (or) <base href="/adfactor/"> replaced to <base href="/tstat/">
|
* <base href="/adfactor/"> (or) <base href="/adfactor/"> replaced to <base href="/tstat/">
|
||||||
* Check File : App.dart -> line 37 need to uncomment it "SemanticsBinding" **/
|
* Check File : App.dart -> line 37 need to uncomment it "SemanticsBinding" **/
|
||||||
const String apiUrl = 'https://apitest.tripapprovaltool.com/tstat_be';
|
// const String apiUrl = 'https://apitest.tripapprovaltool.com/tstat_be';
|
||||||
|
|
||||||
/** Note : TSTAT UAT BE URL
|
/** Note : TSTAT UAT BE URL
|
||||||
* incase "adfactor" or "aujas" href means changed to "tstat"
|
* incase "adfactor" or "aujas" href means changed to "tstat"
|
||||||
* File : web/index.html - change below
|
* File : web/index.html - change below
|
||||||
* <base href="/adfactor/"> (or) <base href="/adfactor/"> replaced to <base href="/tstat/">
|
* <base href="/adfactor/"> (or) <base href="/adfactor/"> replaced to <base href="/tstat/">
|
||||||
* Check File : App.dart -> line 37 need to comment it "SemanticsBinding" **/
|
* Check File : App.dart -> line 37 need to comment it "SemanticsBinding" **/
|
||||||
|
|
||||||
// const String apiUrl = 'https://uat.tripapprovaltool.com/tstat_be';
|
// const String apiUrl = 'https://uat.tripapprovaltool.com/tstat_be';
|
||||||
|
|
||||||
/** Note : Adfactor UAT BE URL
|
/** Note : Adfactor UAT BE URL
|
||||||
@ -32,4 +33,4 @@ const String apiUrl = 'https://apitest.tripapprovaltool.com/tstat_be';
|
|||||||
* incase "tstat" or "adfactor" href means changed to "aujas"
|
* incase "tstat" or "adfactor" href means changed to "aujas"
|
||||||
* File : web/index.html - change below
|
* File : web/index.html - change below
|
||||||
* <base href="/tstat/"> (or) <base href="/adfactor/"> replaced to <base href="/aujas/"> **/
|
* <base href="/tstat/"> (or) <base href="/adfactor/"> replaced to <base href="/aujas/"> **/
|
||||||
// const String apiUrl = 'https://tripapprovaltool.com/aujas_be' ;
|
const String apiUrl = 'https://tripapprovaltool.com/aujas_be';
|
||||||
|
|||||||
@ -170,7 +170,6 @@ class CommentModalState extends State<CommentModal> {
|
|||||||
print("Remarks Data - remarksData");
|
print("Remarks Data - remarksData");
|
||||||
|
|
||||||
final String apiUrldata = '$apiUrl/api/plans/addOrEditPlanRemark';
|
final String apiUrldata = '$apiUrl/api/plans/addOrEditPlanRemark';
|
||||||
// final String apiUrldata = '$apiUrl/api/plans/createOrEditPlan';
|
|
||||||
|
|
||||||
final token = await getToken(); // Fetch token
|
final token = await getToken(); // Fetch token
|
||||||
|
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
This is a placeholder for base href that will be replaced by the value of
|
This is a placeholder for base href that will be replaced by the value of
|
||||||
the `--base-href` argument provided to `flutter build`.
|
the `--base-href` argument provided to `flutter build`.
|
||||||
-->
|
-->
|
||||||
<base href="/tstat/">
|
<base href="/aujas/">
|
||||||
|
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
|
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user