From 5a776c39d0b5dbf5b0244f862df3e98ab9120876 Mon Sep 17 00:00:00 2001 From: venba-Inspriron-3558 Date: Wed, 30 Jul 2025 11:53:55 +0530 Subject: [PATCH] status board temp alignment --- lib/Screens/approvals/approval_list.dart | 36 ++- lib/Screens/dashboard/status_dashboard.dart | 80 ++++- lib/Screens/plans/list_plans.dart | 311 +------------------- lib/app.dart | 6 +- lib/config/apiUrl.dart | 29 +- 5 files changed, 141 insertions(+), 321 deletions(-) diff --git a/lib/Screens/approvals/approval_list.dart b/lib/Screens/approvals/approval_list.dart index 9a17d5c..866af03 100644 --- a/lib/Screens/approvals/approval_list.dart +++ b/lib/Screens/approvals/approval_list.dart @@ -1439,7 +1439,9 @@ class _ApprovalListState extends State { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(12), ), - elevation: 3, + elevation: 3, // Control the strength of the shadow + // shadowColor: Colors.black54, // Softer shadow + // clipBehavior: Clip.antiAlias, child: Padding( padding: const EdgeInsets.all(10.0), child: Row( @@ -1480,7 +1482,7 @@ class _ApprovalListState extends State { CrossAxisAlignment.start, children: [ Text( - ' ${plan.tripTitle}', + '${plan.tripTitle}', style: GoogleFonts.poppins( fontSize: 12, fontWeight: @@ -1494,6 +1496,12 @@ class _ApprovalListState extends State { SizedBox(width: 10), Column( children: [ + // PlanPopupMenu( + // plan: plan, + // deletePlan: deletePlan, + // apiService: apiService, + // layoutColor: layoutColor, + // ), PopupMenuButton( color: Colors.white, padding: EdgeInsets.zero, @@ -1541,8 +1549,8 @@ class _ApprovalListState extends State { plan.planId, plan.approverId, plan.delegaterId, - isViewMode: true, - isApprover: true, + isViewMode:true, + isApprover:true, ); }, ), @@ -1575,14 +1583,20 @@ class _ApprovalListState extends State { IconButton( icon: Icon( Icons - .cancel_rounded, + .download, + color: Color( + 0xFF114D8B, + ), size: 18, ), tooltip: - 'Cancellation The Trip Details', + 'Download The PDF', onPressed: () { Navigator.pop(context); - deletePlan(plan.planId); + apiService + .getPdfDownload( + plan.planId, + ); }, ), IconButton( @@ -1597,7 +1611,9 @@ class _ApprovalListState extends State { tooltip: 'Download The PDF', onPressed: () { - Navigator.pop(context); + Navigator.pop( + context, + ); apiService .getPdfDownload( plan.planId, @@ -1657,11 +1673,13 @@ class _ApprovalListState extends State { CrossAxisAlignment.start, children: [ Text( - '${plan.userName.isNotEmpty ? plan.userName : plan.travellerName} ${(plan.employeeCode) ?? ''}', + '${plan.userName.isNotEmpty ? plan.userName : plan.travellerName} (${plan.employeeCode ?? 'No Data'})', style: GoogleFonts.poppins( fontSize: 10, color: Colors.black87, ), + // overflow: TextOverflow.ellipsis, + // maxLines: 2, ), Text( '${_formatDate(plan.createdOn)}', diff --git a/lib/Screens/dashboard/status_dashboard.dart b/lib/Screens/dashboard/status_dashboard.dart index 1693f78..c9544a3 100644 --- a/lib/Screens/dashboard/status_dashboard.dart +++ b/lib/Screens/dashboard/status_dashboard.dart @@ -490,23 +490,66 @@ class StatusDashboardState extends State { ); } + // Widget statusCard(String label, int count, bool isDesktop) { + // return SizedBox( + // width: isDesktop ? 120 : double.infinity, + // height: isDesktop ? 100 : 100, // fixed height for all cards + // child: Container( + // padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 10), + // decoration: BoxDecoration( + // color: const Color(0xFFEAF3FB), + // borderRadius: BorderRadius.circular(8), + // ), + // child: Column( + // mainAxisAlignment: MainAxisAlignment.center, // vertically center everything + // children: [ + // Text( + // count.toString(), + // style: GoogleFonts.poppins( + // fontSize: isDesktop ? 18 : 16, + // color: Colors.black87, + // fontWeight: FontWeight.bold, + // ), + // ), + // const SizedBox(height: 6), + // Text( + // label, + // maxLines: 2, + // overflow: TextOverflow.ellipsis, + // softWrap: true, + // textAlign: TextAlign.center, + // style: GoogleFonts.poppins( + // fontSize: isDesktop ? 12 : 11, + // color: Colors.black87, + // ), + // ), + // ], + // ), + // ), + // ); + // } + Widget statusCard(String label, int count, bool isDesktop) { return SizedBox( width: isDesktop ? 120 : double.infinity, - height: isDesktop ? 100 : 100, // fixed height for all cards + height: isDesktop ? 100 : 60, child: Container( - padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 10), + padding: EdgeInsets.symmetric( + horizontal: isDesktop ? 10 : 18, + vertical: isDesktop ? 10 : 16, + ), decoration: BoxDecoration( color: const Color(0xFFEAF3FB), borderRadius: BorderRadius.circular(8), ), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, // vertically center everything + child: isDesktop + ? Column( + mainAxisAlignment: MainAxisAlignment.center, children: [ Text( count.toString(), style: GoogleFonts.poppins( - fontSize: isDesktop ? 18 : 16, + fontSize: 18, color: Colors.black87, fontWeight: FontWeight.bold, ), @@ -516,19 +559,42 @@ class StatusDashboardState extends State { label, maxLines: 2, overflow: TextOverflow.ellipsis, - softWrap: true, textAlign: TextAlign.center, style: GoogleFonts.poppins( - fontSize: isDesktop ? 12 : 11, + fontSize: 12, color: Colors.black87, ), ), ], + ) + : Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Text( + label, + style: GoogleFonts.poppins( + fontSize: 12, + color: Colors.black87, + ), + ), + ), + const SizedBox(width: 10), + Text( + count.toString(), + style: GoogleFonts.poppins( + fontSize: 16, + color: Colors.black87, + fontWeight: FontWeight.bold, + ), + ), + ], ), ), ); } + Widget buildCategoryCard(String title, IconData icon, List statusLabels,List values) { final statusIcons = [ diff --git a/lib/Screens/plans/list_plans.dart b/lib/Screens/plans/list_plans.dart index 34cf40e..147280a 100644 --- a/lib/Screens/plans/list_plans.dart +++ b/lib/Screens/plans/list_plans.dart @@ -1388,278 +1388,14 @@ class _ListPlansState extends State { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(12), ), - elevation: 3, + elevation: 3, // Control the strength of the shadow + // shadowColor: Colors.black54, // Softer shadow + // clipBehavior: Clip.antiAlias, child: Padding( - padding: const EdgeInsets.all(12.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + padding: const EdgeInsets.all(10.0), + + child: Row( children: [ - // Status and Employee Code - // Row( - // mainAxisAlignment: - // MainAxisAlignment.spaceBetween, - // children: [ - // 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, - // ), - // ), - // ), - // ), - // // PlanPopupMenu( - // // plan: plan, - // // deletePlan: deletePlan, - // // apiService: apiService, - // // layoutColor: layoutColor, - // // ), - // PopupMenuButton( - // color: Colors.white, - // padding: EdgeInsets.zero, - // offset: Offset(0, 30), - // icon: Icon( - // Icons.more_vert, - // size: 14, - // color: Color(0xFF475569), - // ), - // itemBuilder: - // (context) => [ - // CustomPopupMenuEntry( - // child: Container( - // padding: EdgeInsets.symmetric( - // horizontal: 8, - // vertical: 8, - // ), - // child: Row( - // mainAxisSize: - // MainAxisSize.min, - // mainAxisAlignment: - // MainAxisAlignment.center, - // children: [ - // IconButton( - // icon: Icon( - // Icons.remove_red_eye, - // color: Color( - // 0xFF475569, - // ), - // size: 18, - // ), - // tooltip: - // 'View The Trip Details', - // onPressed: () { - // Navigator.pop( - // context, - // ); // Close popup manually - // ApiService.viewPlan( - // context, - // plan.planId, - // isViewMode: true, - // isMyTrips: true, - // ); - // }, - // ), - // if (plan.statusValue == - // "Pending Approval" || - // plan.statusValue == - // "Partially Approved") - // IconButton( - // icon: Image.asset( - // 'assets/images/IconsImg/edit.png', - // width: 20, - // height: 15, - // ), - // tooltip: - // 'Edit Trip Details', - // onPressed: () { - // Navigator.pop( - // context, - // ); - // ApiService.viewPlan( - // context, - // plan.planId, - // isViewMode: false, - // isMyTrips: true, - // ); - // }, - // ), - // IconButton( - // icon: Icon( - // Icons.cancel_rounded, - // size: 18, - // ), - // tooltip: - // 'Cancellation The Trip Details', - // onPressed: () { - // Navigator.pop(context); - // deletePlan(plan.planId); - // }, - // ), - // IconButton( - // icon: Icon( - // Icons.download, - // color: Color( - // 0xFF114D8B, - // ), - // size: 18, - // ), - // tooltip: - // 'Download The PDF', - // onPressed: () { - // Navigator.pop(context); - // apiService - // .getPdfDownload( - // plan.planId, - // ); - // }, - // ), - // IconButton( - // icon: const Icon( - // Icons.comment, - // color: Color( - // 0xFF475569, - // ), - // size: 11, - // ), - // tooltip: 'Trip Comments', - // onPressed: () { - // showDialog( - // context: context, - // builder: - // ( - // context, - // ) => CommentModalList( - // // planId: plan.planId, - // planId: - // plan.planId - // .toString(), - // layoutColorForUser: - // layoutColor!, - // role: "User", - // ), - // ); - // }, - // ), - // ], - // ), - // ), - // ), - // ], - // ), - // ], - // ), - // SizedBox(height: 2), - // // Trip Id and Trip Name - // Row( - // children: [ - // Column( - // crossAxisAlignment: - // CrossAxisAlignment.start, - // children: [ - // Text( - // ' ${plan.tripTitle}', - // style: TextStyle( - // fontSize: 12, - // fontFamily: "Inter", - // fontWeight: FontWeight.bold, - // ), - // ), - // ], - // ), - // ], - // ), - // SizedBox(height: 2), - // // Type and Created On - // Row( - // mainAxisAlignment: - // MainAxisAlignment.spaceBetween, - // children: [ - // Column( - // crossAxisAlignment: - // CrossAxisAlignment.start, - // children: [ - // Text( - // ' ${plan.tripType}', - // style: TextStyle( - // fontSize: 9, - // color: Colors.black87, - // fontFamily: "Inter", - // ), - // ), - // ], - // ), - // Column( - // crossAxisAlignment: - // CrossAxisAlignment.start, - // children: [ - // Text( - // '${_formatDate(plan.createdOn)}', - // style: TextStyle( - // fontSize: 9, - // color: Colors.black87, - // fontFamily: "Inter", - // ), - // ), - // ], - // ), - // ], - // ), - // SizedBox(height: 3), - // // Name - // Row( - // children: [ - // Column( - // crossAxisAlignment: - // CrossAxisAlignment.start, - // children: [ - // Text( - // plan.userName.isNotEmpty - // ? '${plan.userName}' - // : '${plan.travellerName}', - // style: TextStyle( - // fontSize: 9, - // fontFamily: "Inter", - // color: Colors.black87, - // ), - // ), - // ], - // ), - // Spacer(), - // Column( - // crossAxisAlignment: - // CrossAxisAlignment.start, - // children: [ - // Text( - // plan.employeeCode ?? 'No Data', - // style: TextStyle( - // fontSize: 9, - // fontFamily: "Inter", - // color: Colors.black87, - // ), - // ), - // ], - // ), - // ], - // ), - // Actions Expanded( child: Container( // color: Colors.yellow.shade50, @@ -1683,10 +1419,7 @@ class _ListPlansState extends State { : 'assets/images/IconsImg/International_new.png', // width: 65, height: - plan.tripType == - 'Domestic' - ? 28 - : 30, + plan.tripType == 'Domestic' ? 28 : 30, ), ], ), @@ -1759,7 +1492,7 @@ class _ListPlansState extends State { ApiService.viewPlan( context, plan.planId, - isViewMode: true, + isViewMode:true, isMyTrips: true, ); }, @@ -1784,7 +1517,7 @@ class _ListPlansState extends State { ApiService.viewPlan( context, plan.planId, - isViewMode: false, + isViewMode:false, isMyTrips: true, ); }, @@ -1799,8 +1532,7 @@ class _ListPlansState extends State { 'Cancellation The Trip Details', onPressed: () { Navigator.pop(context); - deletePlan(plan.planId); - }, + deletePlan(plan.planId);}, ), IconButton( icon: Icon( @@ -1815,10 +1547,7 @@ class _ListPlansState extends State { 'Download The PDF', onPressed: () { Navigator.pop(context); - apiService - .getPdfDownload( - plan.planId, - ); + apiService.getPdfDownload(plan.planId,); }, ), IconButton( @@ -1834,17 +1563,10 @@ class _ListPlansState extends State { 'Trip Comments', onPressed: () { showDialog( - context: context, - builder: - ( - context, - ) => CommentModalList( - // planId: plan.planId, - planId: - plan.planId - .toString(), - layoutColorForUser: - layoutColor!, + context:context, + builder:(context) => CommentModalList( + planId:plan.planId.toString(), + layoutColorForUser:layoutColor!, role: "User", ), ); @@ -1873,9 +1595,6 @@ class _ListPlansState extends State { CrossAxisAlignment.start, children: [ Text( - // plan.userName.isNotEmpty - // ? plan.userName - // : '${plan.travellerName}', '${plan.userName.isNotEmpty ? plan.userName : plan.travellerName} (${plan.employeeCode ?? 'No Data'})', style: GoogleFonts.poppins( fontSize: 10, diff --git a/lib/app.dart b/lib/app.dart index f7108c6..e02992c 100644 --- a/lib/app.dart +++ b/lib/app.dart @@ -2,7 +2,7 @@ import 'dart:convert'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; -// import 'package:flutter/rendering.dart'; +import 'package:flutter/rendering.dart'; import 'dart:html' as html; import 'package:frontend/config/apiUrl.dart'; // 1 newly added import 'package:frontend/services/apiService.dart'; @@ -34,8 +34,8 @@ class _MyAppState extends State { @override void initState() { super.initState(); - // SemanticsBinding.instance - // .ensureSemantics(); // Safe here -only for testing uncomment, Otherwise Email Template wont allow to type + SemanticsBinding.instance + .ensureSemantics(); // Safe here -only for testing uncomment, Otherwise Email Template wont allow to type if (kIsWeb) { final uri = Uri.parse(html.window.location.href); print("URI - $uri"); diff --git a/lib/config/apiUrl.dart b/lib/config/apiUrl.dart index 3f0712c..94655bd 100644 --- a/lib/config/apiUrl.dart +++ b/lib/config/apiUrl.dart @@ -1,19 +1,36 @@ //api url -// const String apiUrl = 'http://localhost/tstat_be'; -const String apiUrl = 'https://uat.tripapprovaltool.com/tstat_be'; -// const String apiUrl = 'https://apitest.tripapprovaltool.com/tstat_be'; + +/** Note : TSTAT TEST BE URL + * incase "adfactor" or "aujas" href means changed to "tstat" + * File : web/index.html - change below + * (or) replaced to + * Check File : App.dart -> line 37 need to uncomment it "SemanticsBinding" **/ +const String apiUrl = 'https://apitest.tripapprovaltool.com/tstat_be'; + +/** Note : TSTAT UAT BE URL + * incase "adfactor" or "aujas" href means changed to "tstat" + * File : web/index.html - change below + * (or) replaced to + * Check File : App.dart -> line 37 need to comment it "SemanticsBinding" **/ +// const String apiUrl = 'https://uat.tripapprovaltool.com/tstat_be'; + /** Note : Adfactor UAT BE URL + * incase "aujas" or "tstat" href means changed to "adfactor" * File : web/index.html - change below - * replaced to **/ + * (or) replaced to + * Check File : App.dart -> line 37 need to comment it "SemanticsBinding" **/ // const String apiUrl = 'https://uat.tripapprovaltool.com/adfactor_be'; /** Note : Aujas UAT BE URL + * incase "tstat" or "adfactor" href means changed to "aujas" * File : web/index.html - change below - * replaced to **/ + * (or) replaced to + * Check File : App.dart -> line 37 need to comment it "SemanticsBinding" **/ // const String apiUrl = 'https://uat.tripapprovaltool.com/aujas_be'; /** Note : Aujas Live BE URL + * incase "tstat" or "adfactor" href means changed to "aujas" * File : web/index.html - change below - * replaced to **/ + * (or) replaced to **/ // const String apiUrl = 'https://tripapprovaltool.com/aujas_be' ;