status board temp alignment

This commit is contained in:
venba-Inspriron-3558 2025-07-30 11:53:55 +05:30
parent d2b3b792d9
commit 5a776c39d0
5 changed files with 141 additions and 321 deletions

View File

@ -1439,7 +1439,9 @@ class _ApprovalListState extends State<ApprovalList> {
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<ApprovalList> {
CrossAxisAlignment.start,
children: [
Text(
' ${plan.tripTitle}',
'${plan.tripTitle}',
style: GoogleFonts.poppins(
fontSize: 12,
fontWeight:
@ -1494,6 +1496,12 @@ class _ApprovalListState extends State<ApprovalList> {
SizedBox(width: 10),
Column(
children: [
// PlanPopupMenu(
// plan: plan,
// deletePlan: deletePlan,
// apiService: apiService,
// layoutColor: layoutColor,
// ),
PopupMenuButton<int>(
color: Colors.white,
padding: EdgeInsets.zero,
@ -1541,8 +1549,8 @@ class _ApprovalListState extends State<ApprovalList> {
plan.planId,
plan.approverId,
plan.delegaterId,
isViewMode: true,
isApprover: true,
isViewMode:true,
isApprover:true,
);
},
),
@ -1575,14 +1583,20 @@ class _ApprovalListState extends State<ApprovalList> {
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<ApprovalList> {
tooltip:
'Download The PDF',
onPressed: () {
Navigator.pop(context);
Navigator.pop(
context,
);
apiService
.getPdfDownload(
plan.planId,
@ -1657,11 +1673,13 @@ class _ApprovalListState extends State<ApprovalList> {
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)}',

View File

@ -490,23 +490,66 @@ class StatusDashboardState extends State<StatusDashboard> {
);
}
// 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<StatusDashboard> {
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<String> statusLabels,List<int> values) {
final statusIcons = [

View File

@ -1388,278 +1388,14 @@ class _ListPlansState extends State<ListPlans> {
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<int>(
// 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<ListPlans> {
: '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<ListPlans> {
ApiService.viewPlan(
context,
plan.planId,
isViewMode: true,
isViewMode:true,
isMyTrips: true,
);
},
@ -1784,7 +1517,7 @@ class _ListPlansState extends State<ListPlans> {
ApiService.viewPlan(
context,
plan.planId,
isViewMode: false,
isViewMode:false,
isMyTrips: true,
);
},
@ -1799,8 +1532,7 @@ class _ListPlansState extends State<ListPlans> {
'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<ListPlans> {
'Download The PDF',
onPressed: () {
Navigator.pop(context);
apiService
.getPdfDownload(
plan.planId,
);
apiService.getPdfDownload(plan.planId,);
},
),
IconButton(
@ -1834,17 +1563,10 @@ class _ListPlansState extends State<ListPlans> {
'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<ListPlans> {
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,

View File

@ -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<MyApp> {
@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");

View File

@ -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
* <base href="/adfactor/"> (or) <base href="/adfactor/"> replaced to <base href="/tstat/">
* 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
* <base href="/adfactor/"> (or) <base href="/adfactor/"> replaced to <base href="/tstat/">
* 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
* <base href="/tstat/"> replaced to <base href="/adfactor/"> **/
* <base href="/aujas/"> (or)<base href="/tstat/"> replaced to <base href="/adfactor/">
* 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
* <base href="/tstat/"> replaced to <base href="/aujas/"> **/
* <base href="/tstat/"> (or) <base href="/adfactor/"> replaced to <base href="/aujas/">
* 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
* <base href="/tstat/"> 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' ;