From dc4a1530a66c836f41608c7bc70a1425b33e3f85 Mon Sep 17 00:00:00 2001 From: SurendarSuri30 Date: Wed, 28 May 2025 17:14:43 +0530 Subject: [PATCH 1/2] dashboard UI Changes --- lib/Screens/dashboard/status_dashboard.dart | 146 +++++++++++++------- 1 file changed, 99 insertions(+), 47 deletions(-) diff --git a/lib/Screens/dashboard/status_dashboard.dart b/lib/Screens/dashboard/status_dashboard.dart index 4c9d8c8..23227f1 100644 --- a/lib/Screens/dashboard/status_dashboard.dart +++ b/lib/Screens/dashboard/status_dashboard.dart @@ -98,6 +98,41 @@ class StatusDashboardState extends State { } } + Color getStatusColor(String status) { + if (status == "Domestic") return Colors.white; + if (status == "International") return Colors.white; + if (status == "Partially Approved") return Colors.yellow.shade100; + if (status == "Pending Approval") return Colors.greenAccent.shade100; + if (status == "Approved") return Colors.green.shade100; + if (status == "Completed") return Colors.green.shade500; + if (status == "Rejected") return Colors.red.shade100; + if (status == "Cancelled") return Colors.red.shade200; + return Colors.grey.shade100; + } + + IconData getStatusIcon(String title) { + switch (title) { + case "Domestic": + return Icons.directions_bus_filled_outlined; + case "International": + return Icons.airplanemode_active; + case "Partially Approved": + return Icons.pending; + case "Approved": + return Icons.check_circle_outline; + case "Completed": + return Icons.done_all; + case "Rejected": + return Icons.cancel_outlined; + case "Cancelled": + return Icons.cancel_schedule_send_outlined; + + default: + return Icons.info_outline; + } + } + + @override Widget build(BuildContext context) { final typeBasedCount = List>.from( @@ -111,9 +146,12 @@ class StatusDashboardState extends State { print("statusBasedCount - => $statusBasedCount"); // 👇 Local function to create the card widget Widget buildInfoCard(String title, int count, double width) { + print('title $title'); + final color = getStatusColor(title); + final icon = getStatusIcon(title); return Card( elevation: 3, - color: Colors.white, + color: color, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)), child: Container( width: width, @@ -121,10 +159,15 @@ class StatusDashboardState extends State { child: Column( mainAxisSize: MainAxisSize.min, children: [ + Icon(icon, size: 32, color: (title == 'Domestic' || title == 'International') ? Colors.green : Colors.black54), // 👈 Add Icon here + const SizedBox(height: 8), Text( title, textAlign: TextAlign.center, - style: const TextStyle(fontWeight: FontWeight.w600), + style: TextStyle( + fontWeight: FontWeight.w600, + fontSize: (title == 'Domestic' || title == 'International') ? 16 : 14, + ), ), const SizedBox(height: 8), Text( @@ -132,7 +175,7 @@ class StatusDashboardState extends State { style: const TextStyle( fontSize: 22, fontWeight: FontWeight.bold, - color: Colors.blue, + // color: Colors.blue, ), ), ], @@ -154,54 +197,63 @@ class StatusDashboardState extends State { body: Padding( padding: isDesktop ? EdgeInsets.symmetric( - horizontal: MediaQuery.of(context).size.width * 0.1, - vertical: 0, + horizontal: MediaQuery.of(context).size.width * + 0.1, // 30% of screen width as horizontal padding + vertical: 10, // 5% of screen height as vertical padding ) - : const EdgeInsets.all(0), - child: Row( - children: [ - Expanded( - child: Padding( - padding: const EdgeInsets.all(12.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Wrap( - spacing: 10, - runSpacing: 10, - children: typeBasedCount.map((item) { - double cardWidth = isDesktop - ? (MediaQuery.of(context).size.width * 0.75 - 10) / 2 // 80% width padding adjusted - : MediaQuery.of(context).size.width - 24; // full width with padding + : EdgeInsets.all(0), + child:Container( + // padding: const EdgeInsets.all(10.0), + decoration: BoxDecoration( + color: isDesktop ? Colors.white : const Color(0xFFFCFCFC), + borderRadius: BorderRadius.circular(12), // 👈 Set your desired radius + ), + // color: isDesktop ? Colors.white : Color(0xFFFCFCFC), + child: Row( + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.all(30.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Wrap( + spacing: 10, + runSpacing: 10, + children: typeBasedCount.map((item) { + double cardWidth = isDesktop + ? (MediaQuery.of(context).size.width * 0.75 - 10) / 2 // 80% width padding adjusted + : MediaQuery.of(context).size.width - 24; // full width with padding - return SizedBox( - width: cardWidth, - child: buildInfoCard(item['value'], item['count'], cardWidth), - ); - }).toList(), - ), - const SizedBox(height: 20), - Wrap( - spacing: 10, - runSpacing: 10, - children: statusBasedCount.map((item) { - double cardWidth = isDesktop - ? (MediaQuery.of(context).size.width * 0.90 - 50) / 6 // desktop layout: 6 cards per row - : MediaQuery.of(context).size.width - 24; // mobile: full width + return SizedBox( + width: cardWidth, + child: buildInfoCard(item['value'], item['count'], cardWidth), + ); + }).toList(), + ), + const SizedBox(height: 20), + Wrap( + spacing: 10, + runSpacing: 10, + children: statusBasedCount.map((item) { + double cardWidth = isDesktop + ? (MediaQuery.of(context).size.width * 0.90 - 50) / 6 // desktop layout: 6 cards per row + : MediaQuery.of(context).size.width - 24; // mobile: full width - return SizedBox( - width: cardWidth, - child: buildInfoCard(item['value'], item['count'], cardWidth), - ); - }).toList(), - ), + return SizedBox( + width: cardWidth, + child: buildInfoCard(item['value'], item['count'], cardWidth), + ); + }).toList(), + ), - ], - ), - ), - ), - ], - ), + ], + ), + ), + ), + ], + ), + ) ), ); }); From 52fa34bd0d4c55470bce0c35ba3478afccfae3f4 Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Wed, 28 May 2025 13:21:42 +0000 Subject: [PATCH 2/2] minor fixes --- lib/Screens/allTrips/travel_agent_list.dart | 24 +- lib/Screens/approvals/approval_list.dart | 7 +- lib/Screens/forex/forexDetails.dart | 4 +- lib/Screens/group/groupList.dart | 227 +++++++++--------- lib/Screens/itnerary_list/bus_list.dart | 8 + lib/Screens/itnerary_list/insurance_list.dart | 8 + .../itnerary_list/miscellaneous_list.dart | 8 + lib/Screens/itnerary_list/visa_list.dart | 8 + lib/Screens/plans/create_plans.dart | 10 + lib/widgets/popup_listPlan_action.dart | 21 +- 10 files changed, 185 insertions(+), 140 deletions(-) diff --git a/lib/Screens/allTrips/travel_agent_list.dart b/lib/Screens/allTrips/travel_agent_list.dart index 721efe8..39523d1 100644 --- a/lib/Screens/allTrips/travel_agent_list.dart +++ b/lib/Screens/allTrips/travel_agent_list.dart @@ -706,18 +706,18 @@ class _TravelAgentListPlansState extends State { 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, diff --git a/lib/Screens/approvals/approval_list.dart b/lib/Screens/approvals/approval_list.dart index 0cda2f5..7fa0ef4 100644 --- a/lib/Screens/approvals/approval_list.dart +++ b/lib/Screens/approvals/approval_list.dart @@ -55,6 +55,8 @@ class _ApprovalListState extends State { loadInitialData(); }); + print("i am here ........................."); + // futurePlans = fetchPlans(); } @@ -245,7 +247,7 @@ class _ApprovalListState extends State { if (confirmed) { try { Map 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 { {bool isViewMode = false, bool isApprover = true}) async { try { Map planData = await getViewPlan(planId); - - print("ViewAAA - $planData"); + print("viewPlanforApprover.....$planData"); context.go('/createPlan', extra: { 'planData': planData, 'isViewMode': isViewMode, diff --git a/lib/Screens/forex/forexDetails.dart b/lib/Screens/forex/forexDetails.dart index 45230f8..9839ec7 100644 --- a/lib/Screens/forex/forexDetails.dart +++ b/lib/Screens/forex/forexDetails.dart @@ -493,7 +493,7 @@ class ForexDataState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - "Cash", + "Cash (%)", style: GoogleFonts.poppins( fontSize: 12, fontWeight: FontWeight.w600, @@ -540,7 +540,7 @@ class ForexDataState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - "Card", + "Card (%)", style: GoogleFonts.poppins( fontSize: 12, fontWeight: FontWeight.w600, diff --git a/lib/Screens/group/groupList.dart b/lib/Screens/group/groupList.dart index e7591c0..ab9ef8d 100644 --- a/lib/Screens/group/groupList.dart +++ b/lib/Screens/group/groupList.dart @@ -276,7 +276,7 @@ class _GroupListState extends State { 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 { 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), + ), + ], + ), + ], + ), ), - ), - ); + ); }, ); } diff --git a/lib/Screens/itnerary_list/bus_list.dart b/lib/Screens/itnerary_list/bus_list.dart index 4e20724..07795fa 100644 --- a/lib/Screens/itnerary_list/bus_list.dart +++ b/lib/Screens/itnerary_list/bus_list.dart @@ -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', diff --git a/lib/Screens/itnerary_list/insurance_list.dart b/lib/Screens/itnerary_list/insurance_list.dart index e512edb..5c88d65 100644 --- a/lib/Screens/itnerary_list/insurance_list.dart +++ b/lib/Screens/itnerary_list/insurance_list.dart @@ -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', diff --git a/lib/Screens/itnerary_list/miscellaneous_list.dart b/lib/Screens/itnerary_list/miscellaneous_list.dart index ecd1f1d..30e288b 100644 --- a/lib/Screens/itnerary_list/miscellaneous_list.dart +++ b/lib/Screens/itnerary_list/miscellaneous_list.dart @@ -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', diff --git a/lib/Screens/itnerary_list/visa_list.dart b/lib/Screens/itnerary_list/visa_list.dart index cd7a441..589af86 100644 --- a/lib/Screens/itnerary_list/visa_list.dart +++ b/lib/Screens/itnerary_list/visa_list.dart @@ -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', diff --git a/lib/Screens/plans/create_plans.dart b/lib/Screens/plans/create_plans.dart index 52ee358..1a9391c 100644 --- a/lib/Screens/plans/create_plans.dart +++ b/lib/Screens/plans/create_plans.dart @@ -43,6 +43,8 @@ class _CreatePlansState extends State { final FocusNode focusNode = FocusNode(); bool isFocused = false; + late String approverId; + late String delegaterId; @override void initState() { @@ -104,6 +106,14 @@ class _CreatePlansState extends State { // 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 planData = args['planData'] as Map? ?? {}; diff --git a/lib/widgets/popup_listPlan_action.dart b/lib/widgets/popup_listPlan_action.dart index 16a6f7f..b839220 100644 --- a/lib/widgets/popup_listPlan_action.dart +++ b/lib/widgets/popup_listPlan_action.dart @@ -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: () {