Merge branch 'main' of bitbucket.org:venbainformationtechnology/ts-tat

This commit is contained in:
venbaittech 2025-05-29 20:01:32 +05:30
commit 6c3571f4e8
6 changed files with 307 additions and 246 deletions

View File

@ -195,65 +195,78 @@ class StatusDashboardState extends State<StatusDashboard> {
appBar: CustomAppBar(isDesktop: isDesktop),
drawer: CustomDrawer(isDesktop: false),
body: Padding(
padding: isDesktop
? EdgeInsets.symmetric(
horizontal: MediaQuery.of(context).size.width *
0.1, // 30% of screen width as horizontal padding
vertical: 10, // 5% of screen height as vertical 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
padding: isDesktop
? EdgeInsets.symmetric(
horizontal: MediaQuery.of(context).size.width * 0.1, // 30% of screen width as horizontal padding
vertical: 10, // 5% of screen height as vertical padding
)
: EdgeInsets.all(0),
child : LayoutBuilder(
builder: (context, constraints) {
return SingleChildScrollView(
child: ConstrainedBox(
constraints: BoxConstraints(
minHeight: constraints.maxHeight,
),
child: IntrinsicHeight( // Only needed if child layout depends on height
child: Container(
decoration: BoxDecoration(
color: isDesktop ? Colors.white : const Color(0xFFFCFCFC),
borderRadius: BorderRadius.circular(12),
),
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(),
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(),
),
],
),
),
),
),
],
),
)
);
},
)
),
);
});

View File

@ -2594,10 +2594,10 @@ class CreateNewPlansState extends State<CreateNewPlan> {
children: [
Text(
"Trip Name", // Your label
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xFF575A74)),
style: GoogleFonts.poppins(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xFF575A74))
),
SizedBox(height: 5),
CustomTextFieldWrapper(
@ -2774,8 +2774,10 @@ class CreateNewPlansState extends State<CreateNewPlan> {
enabled: !widget.isViewMode,
decoration: InputDecoration(
labelText: "Trip Name *",
labelStyle: GoogleFonts.poppins(fontSize: 14, color: Colors.black54),
labelStyle: GoogleFonts.poppins(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xFF575A74)),
floatingLabelBehavior: FloatingLabelBehavior.never,
border: InputBorder.none,
contentPadding: EdgeInsets.symmetric(vertical: 16),

View File

@ -395,8 +395,10 @@ class _OfficeDetailsState extends State<OfficeDetails> {
children: [
Text(
"Employee Code",
style: GoogleFonts.poppins(
fontSize: 12, fontWeight: FontWeight.w400, color: Colors.black),
style: GoogleFonts.poppins(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xFF575A74))
),
SizedBox(height: 5),
CustomTextFieldUserWrapper(
@ -439,8 +441,10 @@ class _OfficeDetailsState extends State<OfficeDetails> {
children: [
Text(
"Department",
style: GoogleFonts.poppins(
fontSize: 12, fontWeight: FontWeight.w400, color: Colors.black),
style: GoogleFonts.poppins(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xFF575A74))
),
SizedBox(height: 5),
CustomTextFieldUserWrapper(
@ -489,8 +493,10 @@ class _OfficeDetailsState extends State<OfficeDetails> {
children: [
Text(
"Group",
style: GoogleFonts.poppins(
fontSize: 12, fontWeight: FontWeight.w400, color: Colors.black),
style: GoogleFonts.poppins(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xFF575A74))
),
SizedBox(height: 5),
// CustomTextFieldUserWrapper(
@ -627,10 +633,11 @@ class _OfficeDetailsState extends State<OfficeDetails> {
children: [
Text(
"First Approver",
style: GoogleFonts.poppins(
fontSize: 12,
fontWeight: FontWeight.w400,
color: Colors.black),
style: GoogleFonts.poppins(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xFF575A74))
),
SizedBox(height: 5),
CustomTextFieldUserWrapper(
@ -739,10 +746,11 @@ class _OfficeDetailsState extends State<OfficeDetails> {
children: [
Text(
"Second Approver",
style: GoogleFonts.poppins(
fontSize: 12,
fontWeight: FontWeight.w400,
color: Colors.black),
style: GoogleFonts.poppins(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xFF575A74))
),
SizedBox(height: 5),
CustomTextFieldUserWrapper(
@ -850,10 +858,11 @@ class _OfficeDetailsState extends State<OfficeDetails> {
children: [
Text(
"Third Approver",
style: GoogleFonts.poppins(
fontSize: 12,
fontWeight: FontWeight.w400,
color: Colors.black),
style: GoogleFonts.poppins(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xFF575A74))
),
SizedBox(height: 5),
CustomTextFieldUserWrapper(
@ -960,10 +969,11 @@ class _OfficeDetailsState extends State<OfficeDetails> {
children: [
Text(
"Delegate To",
style: GoogleFonts.poppins(
fontSize: 12,
fontWeight: FontWeight.w400,
color: Colors.black),
style: GoogleFonts.poppins(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xFF575A74))
),
SizedBox(height: 5),
CustomTextFieldUserWrapper(
@ -1107,10 +1117,11 @@ class _OfficeDetailsState extends State<OfficeDetails> {
children: [
Text(
"Start Date",
style: GoogleFonts.poppins(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xFF575A74)),
style: GoogleFonts.poppins(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xFF575A74))
),
SizedBox(height: 5),
CustomTextFieldUserWrapper(
@ -1201,8 +1212,11 @@ class _OfficeDetailsState extends State<OfficeDetails> {
children: [
Text(
"End Date",
style: GoogleFonts.poppins(
fontSize: 12, fontWeight: FontWeight.w400, color: Colors.black),
style: GoogleFonts.poppins(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xFF575A74))
),
SizedBox(height: 5),
CustomTextFieldUserWrapper(

View File

@ -515,11 +515,11 @@ class PersonalDetailsState extends State<PersonalDetails> {
: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
buildEmailField(),
SizedBox(height: 8), // Vertical space
buildMobileField(),
SizedBox(height: 8),
SizedBox(height: 8), // Vertical space
buildAlternateMobileField(),
SizedBox(height: 8),
buildEmailField(),
],
),
);
@ -532,19 +532,21 @@ class PersonalDetailsState extends State<PersonalDetails> {
? Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
buildRole(),
SizedBox(
width: 15,
),
if (!widget.apiselectedUser) buildPassword()
if (!widget.apiselectedUser) ...[
buildPassword(),
SizedBox(width: 15),
],
buildRole()
],
)
: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
buildRole(),
SizedBox(height: 8), //
if (!widget.apiselectedUser) buildPassword()
if (!widget.apiselectedUser) ...[
buildPassword(),
SizedBox(height: 8)], //
buildRole()
],
),
);
@ -587,8 +589,10 @@ class PersonalDetailsState extends State<PersonalDetails> {
children: [
Text(
"First Name",
style: GoogleFonts.poppins(
fontSize: 12, fontWeight: FontWeight.w400, color: Colors.black),
style: GoogleFonts.poppins(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xFF575A74))
),
SizedBox(height: 5),
CustomTextFieldUserWrapper(
@ -632,10 +636,10 @@ class PersonalDetailsState extends State<PersonalDetails> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("Last Name",
style: TextStyle(
style: GoogleFonts.poppins(
fontSize: 12,
fontWeight: FontWeight.w200,
color: Colors.black)),
fontWeight: FontWeight.w600,
color: Color(0xFF575A74))),
SizedBox(height: 5),
CustomTextFieldUserWrapper(
isFocused: false,
@ -677,7 +681,9 @@ class PersonalDetailsState extends State<PersonalDetails> {
Text(
"Gender",
style: GoogleFonts.poppins(
fontSize: 12, fontWeight: FontWeight.w400, color: Colors.black),
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xFF575A74)),
),
SizedBox(height: 5),
CustomTextFieldUserWrapper(
@ -794,8 +800,10 @@ class PersonalDetailsState extends State<PersonalDetails> {
children: [
Text(
"Date of Birth",
style: GoogleFonts.poppins(
fontSize: 12, fontWeight: FontWeight.w400, color: Colors.black),
style: GoogleFonts.poppins(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xFF575A74))
),
SizedBox(height: 5),
CustomTextFieldUserWrapper(
@ -848,8 +856,10 @@ class PersonalDetailsState extends State<PersonalDetails> {
children: [
Text(
"Email",
style: GoogleFonts.poppins(
fontSize: 12, fontWeight: FontWeight.w400, color: Colors.black),
style: GoogleFonts.poppins(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xFF575A74))
),
SizedBox(height: 5),
CustomTextFieldUserWrapper(
@ -892,8 +902,10 @@ class PersonalDetailsState extends State<PersonalDetails> {
children: [
Text(
"Mobile Number",
style: GoogleFonts.poppins(
fontSize: 12, fontWeight: FontWeight.w400, color: Colors.black),
style: GoogleFonts.poppins(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xFF575A74))
),
SizedBox(height: 5),
CustomTextFieldUserWrapper(
@ -941,9 +953,9 @@ class PersonalDetailsState extends State<PersonalDetails> {
children: [
Text("Alternate Mobile Number",
style: GoogleFonts.poppins(
fontSize: 12,
fontWeight: FontWeight.w400,
color: Colors.black)),
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xFF575A74))),
SizedBox(height: 5),
CustomTextFieldUserWrapper(
isFocused: false,
@ -1004,8 +1016,10 @@ class PersonalDetailsState extends State<PersonalDetails> {
children: [
Text(
"Country",
style: GoogleFonts.poppins(
fontSize: 12, fontWeight: FontWeight.w400, color: Colors.black),
style: GoogleFonts.poppins(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xFF575A74))
),
SizedBox(height: 5),
CustomTextFieldUserWrapper(
@ -1089,8 +1103,10 @@ class PersonalDetailsState extends State<PersonalDetails> {
children: [
Text(
"Postal Code",
style: GoogleFonts.poppins(
fontSize: 12, fontWeight: FontWeight.w400, color: Colors.black),
style: GoogleFonts.poppins(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xFF575A74))
),
SizedBox(height: 5),
CustomTextFieldUserWrapper(
@ -1130,8 +1146,10 @@ class PersonalDetailsState extends State<PersonalDetails> {
children: [
Text(
"Role ",
style: GoogleFonts.poppins(
fontSize: 12, fontWeight: FontWeight.w400, color: Colors.black),
style: GoogleFonts.poppins(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xFF575A74))
),
SizedBox(height: 5),
CustomTextFieldUserWrapper(
@ -1182,8 +1200,10 @@ class PersonalDetailsState extends State<PersonalDetails> {
children: [
Text(
"Address",
style: GoogleFonts.poppins(
fontSize: 12, fontWeight: FontWeight.w400, color: Colors.black),
style: GoogleFonts.poppins(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xFF575A74))
),
SizedBox(height: 5),
CustomTextFieldUserWrapper(
@ -1219,8 +1239,10 @@ class PersonalDetailsState extends State<PersonalDetails> {
children: [
Text(
"Password",
style: GoogleFonts.poppins(
fontSize: 12, fontWeight: FontWeight.w400, color: Colors.black),
style: GoogleFonts.poppins(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xFF575A74))
),
SizedBox(height: 5),
CustomTextFieldUserWrapper(

View File

@ -171,6 +171,11 @@ class _CustomDrawerState extends State<CustomDrawer> {
),
// _buildDrawerItem(context, Icons.home_outlined, 'Home', '/home'),
if (userData?["role"] == "Org Admin" ||
userData?["role"] == "Travel Admin")
_buildDrawerItem(context, Icons.dashboard, 'Dashboard',
'/StatusDashboard'),
if (userData?["role"] == "Org Admin" ||
userData?["role"] == "Travel Admin")
_buildDrawerItem(context, Icons.insights_outlined, 'All Trips',

View File

@ -102,77 +102,77 @@ class OrganizationSettingState extends State<OrganizationSetting> {
},
];
List<Widget> rows = [];
for (int i = 0; i < menuItems.length; i += cardsPerRow) {
List<Widget> cards = [];
for (int j = i; j < i + cardsPerRow && j < menuItems.length; j++) {
final item = menuItems[j];
cards.add(
Expanded(
child: Card(
margin: EdgeInsets.all(8),
color: Colors.white,
child: InkWell(
onTap: () {
// Navigate using go_router
final route = item['value'] as String;
switch (route) {
case '/OrganizationSetup':
case '/group':
case '/department':
case '/PolicyList':
case '/getPerdiem':
case '/templateList':
case '/costcenter':
case '/hotels':
case '/groupDetails' :
context.go(route);
break;
default:
// Handle unknown routes or do nothing
print('Unknown route: $route');
}
},
child: Padding(
padding: EdgeInsets.all(12),
child: Row(
children: [
Icon(item['icon'], size: 40, color: Color(0xFF114D8B)),
SizedBox(width: 16),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(
item['label'],
style: GoogleFonts.poppins(
fontSize: 14, fontWeight: FontWeight.w500),
),
SizedBox(height: 4),
Text(
item['description'],
style: TextStyle(
fontSize: 14, color: Colors.grey[700]),
),
],
),
),
],
),
),
),
),
),
);
}
rows.add(Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: cards,
));
}
// List<Widget> rows = [];
// for (int i = 0; i < menuItems.length; i += cardsPerRow) {
// List<Widget> cards = [];
// for (int j = i; j < i + cardsPerRow && j < menuItems.length; j++) {
// final item = menuItems[j];
//
// cards.add(
// Expanded(
// child: Card(
// margin: EdgeInsets.all(8),
// color: Colors.white,
// child: InkWell(
// onTap: () {
// // Navigate using go_router
// final route = item['value'] as String;
// switch (route) {
// case '/OrganizationSetup':
// case '/group':
// case '/department':
// case '/PolicyList':
// case '/getPerdiem':
// case '/templateList':
// case '/costcenter':
// case '/hotels':
// case '/groupDetails' :
// context.go(route);
// break;
// default:
// // Handle unknown routes or do nothing
// print('Unknown route: $route');
// }
// },
// child: Padding(
// padding: EdgeInsets.all(12),
// child: Row(
// children: [
// Icon(item['icon'], size: 40, color: Color(0xFF114D8B)),
// SizedBox(width: 16),
// Expanded(
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisSize: MainAxisSize.min,
// children: [
// Text(
// item['label'],
// style: GoogleFonts.poppins(
// fontSize: 14, fontWeight: FontWeight.w500),
// ),
// SizedBox(height: 4),
// Text(
// item['description'],
// style: TextStyle(
// fontSize: 14, color: Colors.grey[700]),
// ),
// ],
// ),
// ),
// ],
// ),
// ),
// ),
// ),
// ),
// );
// }
//
// rows.add(Row(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: cards,
// ));
// }
// return Container(
// // color: Colors.white,
@ -196,7 +196,6 @@ class OrganizationSettingState extends State<OrganizationSetting> {
// ),
// );
return Container(
padding: EdgeInsets.symmetric(vertical: 16, horizontal: 12),
child: Column(
@ -213,58 +212,64 @@ class OrganizationSettingState extends State<OrganizationSetting> {
SizedBox(height: 8),
Divider(thickness: 0.2, color: Colors.blueGrey.shade100),
SizedBox(height: 12),
Wrap(
spacing: 16, // horizontal space between cards
runSpacing: 16, // vertical space between rows
children: menuItems.map((item) {
return SizedBox(
width: isDesktop ? 325 : double.infinity,
child: Card(
color: Colors.white,
child: InkWell(
onTap: () {
final route = item['value'] as String;
context.go(route);
},
child: Padding(
padding: EdgeInsets.all(12),
child: Row(
children: [
Icon(item['icon'], size: 40, color: Color(0xFF114D8B)),
SizedBox(width: 16),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(
item['label'],
style: GoogleFonts.poppins(
fontSize: 14,
fontWeight: FontWeight.w500,
Expanded(
child: SingleChildScrollView(
child: Center(
child: Wrap(
spacing: 16,
runSpacing: 16,
children: menuItems.map((item) {
return SizedBox(
width: isDesktop ? 325 : double.infinity,
child: Card(
color: Colors.white,
child: InkWell(
onTap: () {
final route = item['value'] as String;
context.go(route);
},
child: Padding(
padding: EdgeInsets.all(12),
child: Row(
children: [
Icon(item['icon'], size: 40, color: Color(0xFF114D8B)),
SizedBox(width: 16),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(
item['label'],
style: GoogleFonts.poppins(
fontSize: 14,
fontWeight: FontWeight.w500,
),
),
SizedBox(height: 4),
Text(
item['description'],
maxLines: 1,
overflow: TextOverflow.ellipsis,
softWrap: false,
style: TextStyle(
fontSize: 14,
color: Colors.grey[700],
),
),
],
),
),
),
SizedBox(height: 4),
Text(
item['description'],
maxLines: 1,
overflow: TextOverflow.ellipsis,
softWrap: false,
style: TextStyle(
fontSize: 14,
color: Colors.grey[700],
),
),
],
],
),
),
),
],
),
),
),
),
);
}).toList(),
),
);
}).toList(),
),
),
),
],
),