minor fixes
This commit is contained in:
parent
9cab4b02a3
commit
52fa34bd0d
@ -706,18 +706,18 @@ class _TravelAgentListPlansState extends State<TravelAgentListPlans> {
|
||||
isViewMode: true);
|
||||
},
|
||||
),
|
||||
IconButton(
|
||||
icon: Image.asset(
|
||||
'assets/images/IconsImg/edit.png',
|
||||
width: 20,
|
||||
height: 15),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
ApiService.viewPlan(
|
||||
context, plan.planId,
|
||||
isViewMode: false);
|
||||
},
|
||||
),
|
||||
// IconButton(
|
||||
// icon: Image.asset(
|
||||
// 'assets/images/IconsImg/edit.png',
|
||||
// width: 20,
|
||||
// height: 15),
|
||||
// onPressed: () {
|
||||
// Navigator.pop(context);
|
||||
// ApiService.viewPlan(
|
||||
// context, plan.planId,
|
||||
// isViewMode: false);
|
||||
// },
|
||||
// ),
|
||||
IconButton(
|
||||
icon: Icon(
|
||||
Icons.cancel_rounded,
|
||||
|
||||
@ -55,6 +55,8 @@ class _ApprovalListState extends State<ApprovalList> {
|
||||
loadInitialData();
|
||||
});
|
||||
|
||||
print("i am here .........................");
|
||||
|
||||
// futurePlans = fetchPlans();
|
||||
}
|
||||
|
||||
@ -245,7 +247,7 @@ class _ApprovalListState extends State<ApprovalList> {
|
||||
if (confirmed) {
|
||||
try {
|
||||
Map<String, dynamic> planData = await ApiService.getViewPlan(planId);
|
||||
print("ViewAAA - $planData");
|
||||
print("ViewABC - $planData");
|
||||
refresh();
|
||||
// postPlanData(planData, planId);
|
||||
} catch (e) {
|
||||
@ -286,8 +288,7 @@ class _ApprovalListState extends State<ApprovalList> {
|
||||
{bool isViewMode = false, bool isApprover = true}) async {
|
||||
try {
|
||||
Map<String, dynamic> planData = await getViewPlan(planId);
|
||||
|
||||
print("ViewAAA - $planData");
|
||||
print("viewPlanforApprover.....$planData");
|
||||
context.go('/createPlan', extra: {
|
||||
'planData': planData,
|
||||
'isViewMode': isViewMode,
|
||||
|
||||
@ -493,7 +493,7 @@ class ForexDataState extends State<ForexData> {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Cash",
|
||||
"Cash (%)",
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w600,
|
||||
@ -540,7 +540,7 @@ class ForexDataState extends State<ForexData> {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Card",
|
||||
"Card (%)",
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w600,
|
||||
|
||||
@ -276,7 +276,7 @@ class _GroupListState extends State<GroupList> {
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
// height: MediaQuery.of(context).size.height * 0.89,
|
||||
height: MediaQuery.of(context).size.height * 0.75,
|
||||
padding: const EdgeInsets.all(10),
|
||||
// margin: const EdgeInsets.only(bottom: 10),
|
||||
color: Colors.white,
|
||||
@ -309,125 +309,124 @@ class _GroupListState extends State<GroupList> {
|
||||
itemCount: apiAllGroups!.length,
|
||||
itemBuilder: (context, index) {
|
||||
final group = apiAllGroups![index];
|
||||
return Card(
|
||||
// color: bodyColor,
|
||||
// color: Color(0xFFF5F5F5),
|
||||
color: Colors.white,
|
||||
margin: EdgeInsets.symmetric(vertical: 6, horizontal: 10),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text("Group Name",
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: 11.5, fontWeight: FontWeight.w400)),
|
||||
),
|
||||
Expanded(
|
||||
child: Text("Domestic Policy",
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: 11.5, fontWeight: FontWeight.w400)),
|
||||
),
|
||||
Expanded(
|
||||
child: Text("International Policy",
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: 11.5, fontWeight: FontWeight.w400)),
|
||||
),
|
||||
Expanded(
|
||||
child: Text("Description",
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: 11.5, fontWeight: FontWeight.w400)),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 4),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text("${group['name']}",
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: 13, fontWeight: FontWeight.w600)),
|
||||
),
|
||||
Expanded(
|
||||
child: Text("${group['domestic_policy_name'] ?? 'N/A'}",
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: 13, fontWeight: FontWeight.w600)),
|
||||
),
|
||||
Expanded(
|
||||
child: Text("${group['international_policy_name']}",
|
||||
return Card(
|
||||
// color: bodyColor,
|
||||
// color: Color(0xFFF5F5F5),
|
||||
color: Colors.white,
|
||||
margin: EdgeInsets.symmetric(vertical: 6, horizontal: 10),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text("Group Name",
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: 13, fontWeight: FontWeight.w600))),
|
||||
Expanded(
|
||||
child: Text("${group['description'] ?? 'N/A'}",
|
||||
fontSize: 11.5, fontWeight: FontWeight.w400)),
|
||||
),
|
||||
Expanded(
|
||||
child: Text("Domestic Policy",
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: 13, fontWeight: FontWeight.w600))),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
|
||||
if (group['group_id'] != null) {
|
||||
final newGroupID = int.tryParse(group['group_id'].toString());
|
||||
if (newGroupID != null) {
|
||||
final data = await apiService.getGroupDetailsFind(newGroupID); // ✅ Always an int
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => GroupData(
|
||||
isDesktop: isDesktop,
|
||||
groupId: newGroupID, // Pass the ID
|
||||
groupData: data,
|
||||
layoutColor: layoutColor!,
|
||||
fetchGetGroup: refreshData
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
|
||||
fontSize: 11.5, fontWeight: FontWeight.w400)),
|
||||
),
|
||||
Expanded(
|
||||
child: Text("International Policy",
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: 11.5, fontWeight: FontWeight.w400)),
|
||||
),
|
||||
Expanded(
|
||||
child: Text("Description",
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: 11.5, fontWeight: FontWeight.w400)),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 4),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text("${group['name']}",
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: 13, fontWeight: FontWeight.w600)),
|
||||
),
|
||||
Expanded(
|
||||
child: Text("${group['domestic_policy_name'] ?? 'N/A'}",
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: 13, fontWeight: FontWeight.w600)),
|
||||
),
|
||||
Expanded(
|
||||
child: Text("${group['international_policy_name']}",
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: 13, fontWeight: FontWeight.w600))),
|
||||
Expanded(
|
||||
child: Text("${group['description'] ?? 'N/A'}",
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: 13, fontWeight: FontWeight.w600))),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
if (group['group_id'] != null) {
|
||||
final newGroupID = int.tryParse(
|
||||
group['group_id'].toString());
|
||||
if (newGroupID != null) {
|
||||
final data = await apiService.getGroupDetailsFind(
|
||||
newGroupID); // ✅ Always an int
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) =>
|
||||
GroupData(
|
||||
isDesktop: isDesktop,
|
||||
groupId: newGroupID,
|
||||
// Pass the ID
|
||||
groupData: data,
|
||||
layoutColor: layoutColor!,
|
||||
fetchGetGroup: refreshData
|
||||
),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
print("something went wrong check properly");
|
||||
}
|
||||
},
|
||||
|
||||
} else {
|
||||
print("something went wrong check properly");
|
||||
}
|
||||
},
|
||||
// onTap: () {
|
||||
// context.go("/CreateGroup", extra: group);
|
||||
// },
|
||||
child: Image.asset('assets/images/IconsImg/edit.png',
|
||||
width: 20, height: 15),
|
||||
),
|
||||
SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
final idStr = group['group_id'];
|
||||
final id = int.tryParse(idStr.toString());
|
||||
|
||||
// onTap: () {
|
||||
// context.go("/CreateGroup", extra: group);
|
||||
// },
|
||||
child: Image.asset('assets/images/IconsImg/edit.png',
|
||||
width: 20, height: 15),
|
||||
),
|
||||
SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
final idStr = group['group_id'];
|
||||
final id = int.tryParse(idStr.toString());
|
||||
|
||||
if (id == null) {
|
||||
print("group_id is null");
|
||||
return;
|
||||
}
|
||||
final status = group['is_active'];
|
||||
// print("GroupId : ${group['group_id']} ");
|
||||
deleteGroup(group, id, status);
|
||||
},
|
||||
child: Image.asset('assets/images/IconsImg/delete.png',
|
||||
width: 20, height: 15),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
if (id == null) {
|
||||
print("group_id is null");
|
||||
return;
|
||||
}
|
||||
final status = group['is_active'];
|
||||
// print("GroupId : ${group['group_id']} ");
|
||||
deleteGroup(group, id, status);
|
||||
},
|
||||
child: Image.asset('assets/images/IconsImg/delete.png',
|
||||
width: 20, height: 15),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@ -214,6 +214,14 @@ class BusListWidget extends StatelessWidget {
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
"${item["from"]} - ${item["to"]}",
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w800,
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
GestureDetector(
|
||||
onTap: () => onOpen(true, item, "Bus"),
|
||||
child: Image.asset('assets/images/IconsImg/edit.png',
|
||||
|
||||
@ -192,6 +192,14 @@ class InsuranceListWidget extends StatelessWidget {
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
getRequestForInsuranceType(item["type_of_insurance"]!.toString()),
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w800,
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
GestureDetector(
|
||||
onTap: () => onOpen(true, item, "Insurance"),
|
||||
child: Image.asset('assets/images/IconsImg/edit.png',
|
||||
|
||||
@ -152,6 +152,14 @@ class MiscellaneousListWidget extends StatelessWidget {
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
getRequestValue(item["special_request"]?.toString()),
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w800,
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
GestureDetector(
|
||||
onTap: () => onOpen(true, item, "Miscellaneous"),
|
||||
child: Image.asset('assets/images/IconsImg/edit.png',
|
||||
|
||||
@ -291,6 +291,14 @@ class VisaListWidget extends StatelessWidget {
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
getRequestForVisa(item["type_of_visa"]!.toString()),
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w800,
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
GestureDetector(
|
||||
onTap: () => onOpen(true, item, "Visa"),
|
||||
child: Image.asset('assets/images/IconsImg/edit.png',
|
||||
|
||||
@ -43,6 +43,8 @@ class _CreatePlansState extends State<CreatePlan> {
|
||||
|
||||
final FocusNode focusNode = FocusNode();
|
||||
bool isFocused = false;
|
||||
late String approverId;
|
||||
late String delegaterId;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@ -104,6 +106,14 @@ class _CreatePlansState extends State<CreatePlan> {
|
||||
// final planData = args?['planData'];
|
||||
final bool isViewMode = args?['isViewMode'] ?? false;
|
||||
final bool isApprover = args?['isApprover'] ?? false;
|
||||
String approverId = args?['approver_id'] ?? '';
|
||||
String delegaterId = args?['delegater_id'] ?? '';
|
||||
|
||||
print("args.......................$args");
|
||||
print(approverId);
|
||||
print(delegaterId);
|
||||
|
||||
|
||||
|
||||
final Map<String, dynamic> planData =
|
||||
args['planData'] as Map<String, dynamic>? ?? {};
|
||||
|
||||
@ -21,6 +21,7 @@ class PlanPopupMenu extends StatelessWidget {
|
||||
required this.layoutColor,
|
||||
}) : super(key: key);
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Align(
|
||||
@ -51,15 +52,17 @@ class PlanPopupMenu extends StatelessWidget {
|
||||
isViewMode: true);
|
||||
},
|
||||
),
|
||||
IconButton(
|
||||
icon: Image.asset('assets/images/IconsImg/edit.png',
|
||||
width: 20, height: 15),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
ApiService.viewPlan(context, plan.planId,
|
||||
isViewMode: false);
|
||||
},
|
||||
),
|
||||
|
||||
// IconButton(
|
||||
// icon: Image.asset('assets/images/IconsImg/edit.png',
|
||||
// width: 20, height: 15),
|
||||
// onPressed: () {
|
||||
// Navigator.pop(context);
|
||||
// ApiService.viewPlan(context, plan.planId,
|
||||
// isViewMode: false);
|
||||
// },
|
||||
// ),
|
||||
|
||||
IconButton(
|
||||
icon: Icon(Icons.cancel_rounded, size: 18),
|
||||
onPressed: () {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user