plan creation bugs

This commit is contained in:
venbaittech 2025-06-04 16:10:52 +05:30
parent 8c828b1dac
commit 7c9968c159
4 changed files with 1615 additions and 1405 deletions

View File

@ -9,14 +9,15 @@ class MiscellaneousListWidget extends StatelessWidget {
final Function(String, bool) onAddNew; final Function(String, bool) onAddNew;
final bool isViewMode; final bool isViewMode;
const MiscellaneousListWidget( const MiscellaneousListWidget({
{super.key, super.key,
required this.miscellaneousList, required this.miscellaneousList,
required this.onOpen, required this.onOpen,
required this.onDeleteMiscellaneous, required this.onDeleteMiscellaneous,
required this.apiData, required this.apiData,
required this.onAddNew, required this.onAddNew,
required this.isViewMode}); required this.isViewMode,
});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -34,11 +35,13 @@ class MiscellaneousListWidget extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
MouseRegion( MouseRegion(
cursor: isViewMode cursor:
isViewMode
? SystemMouseCursors.forbidden ? SystemMouseCursors.forbidden
: SystemMouseCursors.click, : SystemMouseCursors.click,
child: GestureDetector( child: GestureDetector(
onTap: isViewMode onTap:
isViewMode
? null ? null
: () { : () {
print("New data"); print("New data");
@ -57,7 +60,7 @@ class MiscellaneousListWidget extends StatelessWidget {
Icons.add_circle_sharp, Icons.add_circle_sharp,
size: 30, size: 30,
color: Color(0xFF114D8B), color: Color(0xFF114D8B),
) ),
], ],
), ),
), ),
@ -95,7 +98,7 @@ class MiscellaneousListWidget extends StatelessWidget {
), ),
const SizedBox(height: 16), const SizedBox(height: 16),
// Scroll behavior based on device // Scroll behavior based on device
_buildData(context, isDesktop) _buildData(context, isDesktop),
], ],
), ),
), ),
@ -173,7 +176,8 @@ class MiscellaneousListWidget extends StatelessWidget {
), ),
SizedBox(width: 10), SizedBox(width: 10),
GestureDetector( GestureDetector(
onTap: () => onOpen(true, item, "Miscellaneous"), // onTap: () => onOpen(true, item, "Miscellaneous"),
onTap: () => onDeleteMiscellaneous(item),
child: Tooltip( child: Tooltip(
message: 'Delete Miscellaneous Details', message: 'Delete Miscellaneous Details',
child: Image.asset( child: Image.asset(
@ -185,9 +189,7 @@ class MiscellaneousListWidget extends StatelessWidget {
), ),
], ],
), ),
Divider( Divider(color: Colors.blueGrey.shade50),
color: Colors.blueGrey.shade50,
),
SizedBox(height: 4), SizedBox(height: 4),
isDesktop isDesktop
? Row( ? Row(
@ -196,18 +198,16 @@ class MiscellaneousListWidget extends StatelessWidget {
flex: 2, flex: 2,
child: Text( child: Text(
"Special Request", "Special Request",
style: GoogleFonts.poppins( style: GoogleFonts.poppins(fontSize: 11),
fontSize: 11, ),
), ),
)),
Expanded( Expanded(
flex: 3, flex: 3,
child: Text( child: Text(
" Comments", " Comments",
style: GoogleFonts.poppins( style: GoogleFonts.poppins(fontSize: 11),
fontSize: 11, ),
), ),
)),
], ],
) )
: SizedBox.shrink(), : SizedBox.shrink(),
@ -218,7 +218,8 @@ class MiscellaneousListWidget extends StatelessWidget {
flex: 2, flex: 2,
child: Text( child: Text(
getRequestValue( getRequestValue(
item["special_request"]?.toString()), item["special_request"]?.toString(),
),
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: 12, fontSize: 12,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -241,8 +242,8 @@ class MiscellaneousListWidget extends StatelessWidget {
children: [ children: [
_buildRow( _buildRow(
"Special Request:", "Special Request:",
getRequestValue( getRequestValue(item["special_request"]?.toString()),
item["special_request"]?.toString())), ),
SizedBox(width: 10), SizedBox(width: 10),
_buildRow("Comments:", item["comments"] ?? "N/A"), _buildRow("Comments:", item["comments"] ?? "N/A"),
], ],
@ -275,23 +276,27 @@ class MiscellaneousListWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Expanded( Expanded(
child: exceedsLimit child:
exceedsLimit
? Tooltip( ? Tooltip(
message: wrapText(value, 50), message: wrapText(value, 50),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.grey.shade200, // Black background color: Colors.grey.shade200, // Black background
borderRadius: BorderRadius.circular(6), borderRadius: BorderRadius.circular(6),
), ),
textStyle: textStyle: TextStyle(
TextStyle(color: Colors.black), // Tooltip text color color: Colors.black,
), // Tooltip text color
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8),
preferBelow: false, preferBelow: false,
child: Text(value.substring(0, limit) + "...", child: Text(
value.substring(0, limit) + "...",
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: 12, fontSize: 12,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
overflow: TextOverflow.ellipsis), overflow: TextOverflow.ellipsis,
),
) )
: Text( : Text(
value, value,
@ -326,14 +331,12 @@ class MiscellaneousListWidget extends StatelessWidget {
children: [ children: [
Text( Text(
title, title,
style: GoogleFonts.poppins( style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600),
fontSize: 12,
fontWeight: FontWeight.w600,
),
), ),
SizedBox(width: 8), SizedBox(width: 8),
Expanded( Expanded(
child: exceedsLimit child:
exceedsLimit
? Tooltip( ? Tooltip(
message: wrapText(value, 50), message: wrapText(value, 50),
decoration: BoxDecoration( decoration: BoxDecoration(
@ -341,7 +344,9 @@ class MiscellaneousListWidget extends StatelessWidget {
borderRadius: BorderRadius.circular(6), borderRadius: BorderRadius.circular(6),
), ),
textStyle: TextStyle( textStyle: TextStyle(
color: Colors.black, fontSize: 12), // Tooltip text color color: Colors.black,
fontSize: 12,
), // Tooltip text color
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8),
preferBelow: false, preferBelow: false,
child: Text( child: Text(
@ -355,7 +360,7 @@ class MiscellaneousListWidget extends StatelessWidget {
); );
} }
// //
// Widget _buildData(BuildContext context) { // Widget _buildData(BuildContext context) {
// return Container( // return Container(
// width: MediaQuery.of(context).size.width, // width: MediaQuery.of(context).size.width,

View File

@ -11,14 +11,15 @@ class TaxiListWidget extends StatelessWidget {
final Function(String, bool) onAddNew; final Function(String, bool) onAddNew;
final bool isViewMode; final bool isViewMode;
const TaxiListWidget( const TaxiListWidget({
{super.key, super.key,
required this.taxiList, required this.taxiList,
required this.apiData, required this.apiData,
required this.onOpen, required this.onOpen,
required this.onDeleteTaxi, required this.onDeleteTaxi,
required this.onAddNew, required this.onAddNew,
required this.isViewMode}); required this.isViewMode,
});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -36,12 +37,14 @@ class TaxiListWidget extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
MouseRegion( MouseRegion(
cursor: isViewMode cursor:
isViewMode
? SystemMouseCursors.forbidden ? SystemMouseCursors.forbidden
: SystemMouseCursors.click, : SystemMouseCursors.click,
child: GestureDetector( child: GestureDetector(
onTap: isViewMode onTap:
isViewMode
? null ? null
: () { : () {
print("New data"); print("New data");
@ -60,7 +63,7 @@ class TaxiListWidget extends StatelessWidget {
Icons.add_circle_sharp, Icons.add_circle_sharp,
size: 30, size: 30,
color: Color(0xFF114D8B), color: Color(0xFF114D8B),
) ),
], ],
), ),
), ),
@ -99,9 +102,9 @@ class TaxiListWidget extends StatelessWidget {
], ],
), ),
const SizedBox(height: 16), const SizedBox(height: 16),
// Scroll behavior based on device
_buildData(context, isDesktop) // Scroll behavior based on device
_buildData(context, isDesktop),
], ],
), ),
), ),
@ -187,8 +190,11 @@ class TaxiListWidget extends StatelessWidget {
if (hour == 24 && minute == 0) { if (hour == 24 && minute == 0) {
// 24:00 is treated as 00:00 on the next day // 24:00 is treated as 00:00 on the next day
dateTime = DateTime(now.year, now.month, now.day) dateTime = DateTime(
.add(const Duration(days: 1)); now.year,
now.month,
now.day,
).add(const Duration(days: 1));
} else { } else {
if (hour < 0 || hour > 23 || minute < 0 || minute > 59) { if (hour < 0 || hour > 23 || minute < 0 || minute > 59) {
throw FormatException("Invalid hour or minute"); throw FormatException("Invalid hour or minute");
@ -242,7 +248,8 @@ class TaxiListWidget extends StatelessWidget {
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: 13, fontSize: 13,
fontWeight: FontWeight.w800, fontWeight: FontWeight.w800,
)), ),
),
Spacer(), Spacer(),
GestureDetector( GestureDetector(
onTap: () => onOpen(true, item, "Taxi"), onTap: () => onOpen(true, item, "Taxi"),
@ -257,7 +264,7 @@ class TaxiListWidget extends StatelessWidget {
), ),
SizedBox(width: 10), SizedBox(width: 10),
GestureDetector( GestureDetector(
onTap: () => (item), onTap: () => onDeleteTaxi(item),
child: Tooltip( child: Tooltip(
message: 'Delete Taxi Details', message: 'Delete Taxi Details',
child: Image.asset( child: Image.asset(
@ -269,9 +276,7 @@ class TaxiListWidget extends StatelessWidget {
), ),
], ],
), ),
Divider( Divider(color: Colors.blueGrey.shade50),
color: Colors.blueGrey.shade50,
),
SizedBox(height: 4), SizedBox(height: 4),
isDesktop isDesktop
? Row( ? Row(
@ -280,34 +285,30 @@ class TaxiListWidget extends StatelessWidget {
flex: 2, flex: 2,
child: Text( child: Text(
"City", "City",
style: GoogleFonts.poppins( style: GoogleFonts.poppins(fontSize: 11),
fontSize: 11, ),
), ),
)),
Expanded( Expanded(
flex: 2, flex: 2,
child: Text( child: Text(
" Location", " Location",
style: GoogleFonts.poppins( style: GoogleFonts.poppins(fontSize: 11),
fontSize: 11, ),
), ),
)),
Expanded( Expanded(
flex: 2, flex: 2,
child: Text( child: Text(
" Date", " Date",
style: GoogleFonts.poppins( style: GoogleFonts.poppins(fontSize: 11),
fontSize: 11, ),
), ),
)),
Expanded( Expanded(
flex: 2, flex: 2,
child: Text( child: Text(
"Comments", "Comments",
style: GoogleFonts.poppins( style: GoogleFonts.poppins(fontSize: 11),
fontSize: 11, ),
), ),
)),
], ],
) )
: SizedBox.shrink(), : SizedBox.shrink(),
@ -351,7 +352,9 @@ class TaxiListWidget extends StatelessWidget {
Expanded( Expanded(
flex: 2, flex: 2,
child: _buildComments( child: _buildComments(
" Comments:", item["comments"] ?? "N/A"), " Comments:",
item["comments"] ?? "N/A",
),
), ),
], ],
) )
@ -370,7 +373,7 @@ class TaxiListWidget extends StatelessWidget {
_buildRow("TaxiFor:", item["car_required_for"]!), _buildRow("TaxiFor:", item["car_required_for"]!),
_buildRow("Comments:", item["comments"] ?? "N/A"), _buildRow("Comments:", item["comments"] ?? "N/A"),
], ],
) ),
], ],
), ),
), ),
@ -399,23 +402,27 @@ class TaxiListWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Expanded( Expanded(
child: exceedsLimit child:
exceedsLimit
? Tooltip( ? Tooltip(
message: wrapText(value, 50), message: wrapText(value, 50),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.grey.shade200, // Black background color: Colors.grey.shade200, // Black background
borderRadius: BorderRadius.circular(6), borderRadius: BorderRadius.circular(6),
), ),
textStyle: textStyle: TextStyle(
TextStyle(color: Colors.black), // Tooltip text color color: Colors.black,
), // Tooltip text color
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8),
preferBelow: false, preferBelow: false,
child: Text(value.substring(0, limit) + "...", child: Text(
value.substring(0, limit) + "...",
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: 12, fontSize: 12,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
overflow: TextOverflow.ellipsis), overflow: TextOverflow.ellipsis,
),
) )
: Text( : Text(
value, value,
@ -450,34 +457,30 @@ class TaxiListWidget extends StatelessWidget {
children: [ children: [
Text( Text(
title, title,
style: TextStyle( style: TextStyle(fontWeight: FontWeight.w600, fontSize: 12),
fontWeight: FontWeight.w600,
fontSize: 12,
),
), ),
SizedBox(width: 8), SizedBox(width: 8),
Expanded( Expanded(
child: exceedsLimit child:
exceedsLimit
? Tooltip( ? Tooltip(
message: wrapText(value, 50), message: wrapText(value, 50),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.grey.shade200, // Black background color: Colors.grey.shade200, // Black background
borderRadius: BorderRadius.circular(6), borderRadius: BorderRadius.circular(6),
), ),
textStyle: textStyle: TextStyle(
TextStyle(color: Colors.black), // Tooltip text color color: Colors.black,
), // Tooltip text color
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8),
preferBelow: false, preferBelow: false,
child: Text(value.substring(0, limit) + "...", child: Text(
value.substring(0, limit) + "...",
style: TextStyle(fontSize: 12), style: TextStyle(fontSize: 12),
overflow: TextOverflow.ellipsis), overflow: TextOverflow.ellipsis,
),
) )
: Text( : Text(value, style: GoogleFonts.poppins(fontSize: 12)),
value,
style: GoogleFonts.poppins(
fontSize: 12,
),
),
), ),
], ],
); );
@ -489,19 +492,11 @@ class TaxiListWidget extends StatelessWidget {
children: [ children: [
Text( Text(
title, title,
style: GoogleFonts.poppins( style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600),
fontSize: 12,
fontWeight: FontWeight.w600,
),
), ),
SizedBox(width: 8), SizedBox(width: 8),
Expanded( Expanded(
child: Text( child: Text("$date, $time", style: GoogleFonts.poppins(fontSize: 12)),
"$date, $time",
style: GoogleFonts.poppins(
fontSize: 12,
),
),
), ),
], ],
); );

File diff suppressed because it is too large Load Diff

View File

@ -273,6 +273,7 @@ class _CustomAppBarState extends State<CustomAppBar> {
location.contains('/listTravelAgentPlan')) { location.contains('/listTravelAgentPlan')) {
selectedTab = TabSelection.myTrips; selectedTab = TabSelection.myTrips;
} else if (location.contains('/ApprovalList') || } else if (location.contains('/ApprovalList') ||
location.contains('/approvallist') ||
location.contains('/approver/plans')) { location.contains('/approver/plans')) {
selectedTab = TabSelection.myApprovals; selectedTab = TabSelection.myApprovals;
} else { } else {