This commit is contained in:
venbaittech 2025-06-09 15:01:30 +05:30
parent 20a24c7d46
commit a8712dcb68
9 changed files with 484 additions and 446 deletions

View File

@ -387,7 +387,7 @@ class _AccomodationScreenState extends State<AccomodationScreen> {
child: Column( child: Column(
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.all(28.0), padding: const EdgeInsets.only(top: 30.0),
child: Center( child: Center(
child: Column(children: _buildAccomadtionForm(isDesktop)), child: Column(children: _buildAccomadtionForm(isDesktop)),
), ),

View File

@ -13,12 +13,13 @@ class BusScreen extends StatefulWidget {
final Map<String, dynamic>? selectedItem; final Map<String, dynamic>? selectedItem;
final String? loginUser; final String? loginUser;
BusScreen( BusScreen({
{required this.onClose, required this.onClose,
this.apiData, this.apiData,
required this.onSaveBus, required this.onSaveBus,
required this.selectedItem, required this.selectedItem,
required this.loginUser}); required this.loginUser,
});
@override @override
_BusScreenState createState() => _BusScreenState(); _BusScreenState createState() => _BusScreenState();
@ -195,9 +196,11 @@ class _BusScreenState extends State<BusScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ResponsiveBuilder(builder: (context, sizingInfo) { return ResponsiveBuilder(
builder: (context, sizingInfo) {
bool isMobile = sizingInfo.isMobile; bool isMobile = sizingInfo.isMobile;
bool isDesktop = sizingInfo.deviceScreenType == DeviceScreenType.desktop; bool isDesktop =
sizingInfo.deviceScreenType == DeviceScreenType.desktop;
return Container( return Container(
// color: Colors.white, // color: Colors.white,
@ -229,17 +232,18 @@ class _BusScreenState extends State<BusScreen> {
// height: 6, // height: 6,
// ), // ),
Padding( Padding(
padding: const EdgeInsets.all(28.0), padding: const EdgeInsets.only(top: 30.0),
child: Center( child: Center(
child: Column(children: _buildAccomadtionForm(isDesktop)), child: Column(children: _buildAccomadtionForm(isDesktop)),
), ),
) ),
], ],
), ),
), ),
), ),
); );
}); },
);
} }
List<Widget> _buildAccomadtionForm(bool isDesktop) { List<Widget> _buildAccomadtionForm(bool isDesktop) {
@ -252,7 +256,7 @@ class _BusScreenState extends State<BusScreen> {
List<List<Widget>> rowBuilders = [ List<List<Widget>> rowBuilders = [
// _builClassType(isDesktop), // _builClassType(isDesktop),
_buildSecondRow(isDesktop) _buildSecondRow(isDesktop),
]; ];
return [ return [
@ -277,39 +281,40 @@ class _BusScreenState extends State<BusScreen> {
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: 12, fontSize: 12,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: Color(0xFF575A74)), color: Color(0xFF575A74),
),
), ),
SizedBox(height: 5), SizedBox(height: 5),
isDesktop isDesktop
? Row(children: _buildTripType(isDesktop)) ? Row(children: _buildTripType(isDesktop))
: Column(children: _buildTripType(isDesktop)) : Column(children: _buildTripType(isDesktop)),
], ],
), ),
if (isDesktop) if (isDesktop) Spacer() else SizedBox(height: 8),
Spacer()
else
SizedBox(
height: 8,
),
]; ];
} }
List<Widget> _buildTripType(bool isDesktop) { List<Widget> _buildTripType(bool isDesktop) {
List<dynamic> purposeList = widget.apiData?['flight_trip_type'] ?? []; List<dynamic> purposeList = widget.apiData?['flight_trip_type'] ?? [];
List<DropdownMenuItem<String>> dropdownItems = purposeList List<DropdownMenuItem<String>> dropdownItems =
.map((item) => DropdownMenuItem<String>( purposeList
.map(
(item) => DropdownMenuItem<String>(
value: item['dropdown_key'], value: item['dropdown_key'],
child: Text(item['dropdown_value']), child: Text(item['dropdown_value']),
)) ),
)
.toList(); .toList();
if (dropdownItems.isEmpty) { if (dropdownItems.isEmpty) {
dropdownItems.add( dropdownItems.add(
DropdownMenuItem<String>( DropdownMenuItem<String>(
value: null, value: null,
child: Text("No options available", child: Text(
style: TextStyle(color: Colors.grey)), "No options available",
style: TextStyle(color: Colors.grey),
),
), ),
); );
} }
@ -331,16 +336,19 @@ class _BusScreenState extends State<BusScreen> {
style: GoogleFonts.poppins(fontSize: 12, color: Colors.black), style: GoogleFonts.poppins(fontSize: 12, color: Colors.black),
decoration: InputDecoration( decoration: InputDecoration(
border: InputBorder.none, border: InputBorder.none,
contentPadding: contentPadding: EdgeInsets.symmetric(
EdgeInsets.symmetric(horizontal: 10), // Proper padding horizontal: 10,
), // Proper padding
), ),
onChanged: purposeList.isNotEmpty onChanged:
purposeList.isNotEmpty
? (newValue) { ? (newValue) {
setState(() { setState(() {
selectedPurpose = newValue; selectedPurpose = newValue;
}); });
print( print(
"Updating form data: Flight -> trip_type -> ${newValue ?? ""}"); "Updating form data: Flight -> trip_type -> ${newValue ?? ""}",
);
} }
: null, : null,
@ -361,7 +369,8 @@ class _BusScreenState extends State<BusScreen> {
DateTime? pickedDate = await showDatePicker( DateTime? pickedDate = await showDatePicker(
context: context, context: context,
initialDate: _selectedCheckOutDate != null && initialDate:
_selectedCheckOutDate != null &&
_selectedCheckOutDate!.isAfter(today) _selectedCheckOutDate!.isAfter(today)
? _selectedCheckOutDate! ? _selectedCheckOutDate!
: today, : today,
@ -399,7 +408,6 @@ class _BusScreenState extends State<BusScreen> {
pickedTime.minute, pickedTime.minute,
); );
final isToday = final isToday =
selectedDate.year == now.year && selectedDate.year == now.year &&
selectedDate.month == now.month && selectedDate.month == now.month &&
@ -414,16 +422,23 @@ class _BusScreenState extends State<BusScreen> {
_timeController.text = ""; // Clear text field _timeController.text = ""; // Clear text field
}); });
return; return;
}else{ setState(() { } else {
setState(() {
_selectedCheckOutTime = pickedTime; _selectedCheckOutTime = pickedTime;
// Formatting time to HH:mm (24-hour format) // Formatting time to HH:mm (24-hour format)
final now = DateTime.now(); final now = DateTime.now();
final formattedTime = DateFormat('HH:mm').format( final formattedTime = DateFormat('HH:mm').format(
DateTime(now.year, now.month, now.day, pickedTime.hour, DateTime(
pickedTime.minute), now.year,
now.month,
now.day,
pickedTime.hour,
pickedTime.minute,
),
); );
_timeController.text = formattedTime; _timeController.text = formattedTime;
}); } });
}
} }
} }
@ -436,7 +451,8 @@ class _BusScreenState extends State<BusScreen> {
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: 12, fontSize: 12,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: Color(0xFF575A74)), color: Color(0xFF575A74),
),
), ),
SizedBox(height: 5), SizedBox(height: 5),
CustomTextFieldItnerarySubWrapper( CustomTextFieldItnerarySubWrapper(
@ -460,19 +476,11 @@ class _BusScreenState extends State<BusScreen> {
), ),
if (errorMessages["from"] != null) ...[ if (errorMessages["from"] != null) ...[
SizedBox(height: 5), // Space before error message SizedBox(height: 5), // Space before error message
Text( Text("Required", style: TextStyle(color: Colors.red, fontSize: 12)),
"Required",
style: TextStyle(color: Colors.red, fontSize: 12),
),
], ],
], ],
), ),
if (isDesktop) if (isDesktop) Spacer() else SizedBox(height: 8),
Spacer()
else
SizedBox(
height: 8,
),
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -481,7 +489,8 @@ class _BusScreenState extends State<BusScreen> {
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: 12, fontSize: 12,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: Color(0xFF575A74)), color: Color(0xFF575A74),
),
), ),
SizedBox(height: 5), SizedBox(height: 5),
CustomTextFieldItnerarySubWrapper( CustomTextFieldItnerarySubWrapper(
@ -505,19 +514,11 @@ class _BusScreenState extends State<BusScreen> {
), ),
if (errorMessages["to"] != null) ...[ if (errorMessages["to"] != null) ...[
SizedBox(height: 5), // Space before error message SizedBox(height: 5), // Space before error message
Text( Text("Required", style: TextStyle(color: Colors.red, fontSize: 12)),
"Required",
style: TextStyle(color: Colors.red, fontSize: 12),
),
], ],
], ],
), ),
if (isDesktop) if (isDesktop) Spacer() else SizedBox(height: 8),
Spacer()
else
SizedBox(
height: 8,
),
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -526,7 +527,8 @@ class _BusScreenState extends State<BusScreen> {
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: 12, fontSize: 12,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: Color(0xFF575A74)), color: Color(0xFF575A74),
),
), ),
SizedBox(height: 5), SizedBox(height: 5),
CustomTextFieldItnerarySubWrapper( CustomTextFieldItnerarySubWrapper(
@ -547,8 +549,11 @@ class _BusScreenState extends State<BusScreen> {
floatingLabelBehavior: FloatingLabelBehavior.never, floatingLabelBehavior: FloatingLabelBehavior.never,
border: InputBorder.none, border: InputBorder.none,
contentPadding: EdgeInsets.symmetric(vertical: 16), contentPadding: EdgeInsets.symmetric(vertical: 16),
suffixIcon: Icon(Icons.calendar_today, suffixIcon: Icon(
size: 16, color: Colors.grey), Icons.calendar_today,
size: 16,
color: Colors.grey,
),
), ),
), ),
), ),
@ -557,19 +562,11 @@ class _BusScreenState extends State<BusScreen> {
), ),
if (errorMessages["date"] != null) ...[ if (errorMessages["date"] != null) ...[
SizedBox(height: 5), // Space before error message SizedBox(height: 5), // Space before error message
Text( Text("Required", style: TextStyle(color: Colors.red, fontSize: 12)),
"Required",
style: TextStyle(color: Colors.red, fontSize: 12),
),
], ],
], ],
), ),
if (isDesktop) if (isDesktop) Spacer() else SizedBox(height: 8),
Spacer()
else
SizedBox(
height: 8,
),
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -578,7 +575,8 @@ class _BusScreenState extends State<BusScreen> {
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: 12, fontSize: 12,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: Color(0xFF575A74)), color: Color(0xFF575A74),
),
), ),
SizedBox(height: 5), SizedBox(height: 5),
CustomTextFieldItnerarySubWrapper( CustomTextFieldItnerarySubWrapper(
@ -599,8 +597,11 @@ class _BusScreenState extends State<BusScreen> {
floatingLabelBehavior: FloatingLabelBehavior.never, floatingLabelBehavior: FloatingLabelBehavior.never,
border: InputBorder.none, border: InputBorder.none,
contentPadding: EdgeInsets.symmetric(vertical: 16), contentPadding: EdgeInsets.symmetric(vertical: 16),
suffixIcon: suffixIcon: Icon(
Icon(Icons.access_time, size: 16, color: Colors.grey), Icons.access_time,
size: 16,
color: Colors.grey,
),
), ),
), ),
), ),
@ -629,7 +630,8 @@ class _BusScreenState extends State<BusScreen> {
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: 12, fontSize: 12,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: Color(0xFF575A74)), color: Color(0xFF575A74),
),
), ),
SizedBox(height: 5), SizedBox(height: 5),
CustomTextFieldWrapper( CustomTextFieldWrapper(
@ -675,9 +677,7 @@ class _BusScreenState extends State<BusScreen> {
}, },
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
backgroundColor: Colors.grey[400], // Light grey color backgroundColor: Colors.grey[400], // Light grey color
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
borderRadius: BorderRadius.circular(8),
),
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 12), padding: EdgeInsets.symmetric(horizontal: 20, vertical: 12),
), ),
child: Text( child: Text(
@ -686,7 +686,6 @@ class _BusScreenState extends State<BusScreen> {
), ),
), ),
SizedBox(width: 10), // Space between buttons SizedBox(width: 10), // Space between buttons
// Save Changes Button // Save Changes Button
ElevatedButton( ElevatedButton(
onPressed: () { onPressed: () {
@ -694,9 +693,7 @@ class _BusScreenState extends State<BusScreen> {
}, },
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
backgroundColor: Color(0xFF114D8B), // Primary color for save backgroundColor: Color(0xFF114D8B), // Primary color for save
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
borderRadius: BorderRadius.circular(8),
),
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 12), padding: EdgeInsets.symmetric(horizontal: 20, vertical: 12),
), ),
child: Text( child: Text(

View File

@ -1203,7 +1203,8 @@ class _ForexScreenState extends State<ForexScreen> {
// height: 8, // height: 8,
// ), // ),
if (isDesktop) if (isDesktop)
SizedBox(width: MediaQuery.of(context).size.width * 0.048) Spacer()
// SizedBox(width: MediaQuery.of(context).size.width * 0.048)
else else
SizedBox(height: 8), SizedBox(height: 8),
Column( Column(

View File

@ -14,13 +14,14 @@ class MiscellaneousScreen extends StatefulWidget {
final int? selectedIndex; final int? selectedIndex;
final String? loginUser; final String? loginUser;
MiscellaneousScreen( MiscellaneousScreen({
{required this.onClose, required this.onClose,
required this.apiData, required this.apiData,
required this.onSaveMiscellaneous, required this.onSaveMiscellaneous,
this.selectedItem, this.selectedItem,
this.selectedIndex, this.selectedIndex,
required this.loginUser}); required this.loginUser,
});
@override @override
_MiscellaneousScreenState createState() => _MiscellaneousScreenState(); _MiscellaneousScreenState createState() => _MiscellaneousScreenState();
@ -87,8 +88,9 @@ class _MiscellaneousScreenState extends State<MiscellaneousScreen> {
}); });
}); });
_commentsController = _commentsController = TextEditingController(
TextEditingController(text: widget.selectedItem?["comments"] ?? ""); text: widget.selectedItem?["comments"] ?? "",
);
// Set the selected value if available // Set the selected value if available
if (widget.selectedItem != null && if (widget.selectedItem != null &&
@ -143,9 +145,11 @@ class _MiscellaneousScreenState extends State<MiscellaneousScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ResponsiveBuilder(builder: (context, sizingInfo) { return ResponsiveBuilder(
builder: (context, sizingInfo) {
bool isMobile = sizingInfo.isMobile; bool isMobile = sizingInfo.isMobile;
bool isDesktop = sizingInfo.deviceScreenType == DeviceScreenType.desktop; bool isDesktop =
sizingInfo.deviceScreenType == DeviceScreenType.desktop;
return Container( return Container(
child: Form( child: Form(
@ -155,17 +159,18 @@ class _MiscellaneousScreenState extends State<MiscellaneousScreen> {
child: Column( child: Column(
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.all(28.0), padding: const EdgeInsets.only(top: 30.0),
child: Center( child: Center(
child: Column(children: _buildAccomadtionForm(isDesktop)), child: Column(children: _buildAccomadtionForm(isDesktop)),
), ),
) ),
], ],
), ),
), ),
), ),
); );
}); },
);
} }
List<Widget> _buildAccomadtionForm(bool isDesktop) { List<Widget> _buildAccomadtionForm(bool isDesktop) {
@ -195,12 +200,13 @@ class _MiscellaneousScreenState extends State<MiscellaneousScreen> {
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: 12, fontSize: 12,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: Color(0xFF575A74)), color: Color(0xFF575A74),
),
), ),
SizedBox(height: 5), SizedBox(height: 5),
isDesktop isDesktop
? Row(children: _buildTripType(isDesktop)) ? Row(children: _buildTripType(isDesktop))
: Column(children: _buildTripType(isDesktop)) : Column(children: _buildTripType(isDesktop)),
], ],
), ),
]; ];
@ -211,19 +217,24 @@ class _MiscellaneousScreenState extends State<MiscellaneousScreen> {
widget.apiData?['miscellaneous_special_request'] ?? []; widget.apiData?['miscellaneous_special_request'] ?? [];
// selectedInsuranceType = purposeList.isNotEmpty ? purposeList.first['dropdown_value'] : null; // selectedInsuranceType = purposeList.isNotEmpty ? purposeList.first['dropdown_value'] : null;
List<DropdownMenuItem<String>> dropdownItems = purposeList List<DropdownMenuItem<String>> dropdownItems =
.map((item) => DropdownMenuItem<String>( purposeList
.map(
(item) => DropdownMenuItem<String>(
value: item['dropdown_key'], value: item['dropdown_key'],
child: Text(item['dropdown_value']), child: Text(item['dropdown_value']),
)) ),
)
.toList(); .toList();
if (dropdownItems.isEmpty) { if (dropdownItems.isEmpty) {
dropdownItems.add( dropdownItems.add(
DropdownMenuItem<String>( DropdownMenuItem<String>(
value: null, value: null,
child: Text("No options available", child: Text(
style: TextStyle(color: Colors.grey)), "No options available",
style: TextStyle(color: Colors.grey),
),
), ),
); );
} }
@ -236,7 +247,8 @@ class _MiscellaneousScreenState extends State<MiscellaneousScreen> {
CustomTextFieldWrapper( CustomTextFieldWrapper(
isFocused: _isHotelNameFocused, isFocused: _isHotelNameFocused,
isDesktop: isDesktop, isDesktop: isDesktop,
width: isDesktop width:
isDesktop
? MediaQuery.of(context).size.width * 0.34 ? MediaQuery.of(context).size.width * 0.34
: MediaQuery.of(context).size.width * 0.66, : MediaQuery.of(context).size.width * 0.66,
child: SizedBox( child: SizedBox(
@ -247,10 +259,12 @@ class _MiscellaneousScreenState extends State<MiscellaneousScreen> {
style: TextStyle(fontSize: 12), style: TextStyle(fontSize: 12),
decoration: InputDecoration( decoration: InputDecoration(
border: InputBorder.none, border: InputBorder.none,
contentPadding: contentPadding: EdgeInsets.symmetric(
EdgeInsets.symmetric(horizontal: 10), // Proper padding horizontal: 10,
), // Proper padding
), ),
onChanged: purposeList.isNotEmpty onChanged:
purposeList.isNotEmpty
? (newValue) { ? (newValue) {
setState(() { setState(() {
selectedSpecialType = newValue; selectedSpecialType = newValue;
@ -265,10 +279,7 @@ class _MiscellaneousScreenState extends State<MiscellaneousScreen> {
), ),
if (errorMessages["special_request"] != null) ...[ if (errorMessages["special_request"] != null) ...[
SizedBox(height: 5), // Space before error message SizedBox(height: 5), // Space before error message
Text( Text("Required", style: TextStyle(color: Colors.red, fontSize: 12)),
"Required",
style: TextStyle(color: Colors.red, fontSize: 12),
),
], ],
]; ];
} }
@ -283,13 +294,15 @@ class _MiscellaneousScreenState extends State<MiscellaneousScreen> {
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: 12, fontSize: 12,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: Color(0xFF575A74)), color: Color(0xFF575A74),
),
), ),
SizedBox(height: 5), SizedBox(height: 5),
CustomTextFieldWrapper( CustomTextFieldWrapper(
isFocused: _commentsFocus, // Dropdown doesn't use focus isFocused: _commentsFocus, // Dropdown doesn't use focus
isDesktop: isDesktop, isDesktop: isDesktop,
width: isDesktop width:
isDesktop
? MediaQuery.of(context).size.width * 0.34 ? MediaQuery.of(context).size.width * 0.34
: MediaQuery.of(context).size.width * 0.66, : MediaQuery.of(context).size.width * 0.66,
child: SizedBox( child: SizedBox(
@ -310,17 +323,12 @@ class _MiscellaneousScreenState extends State<MiscellaneousScreen> {
), ),
if (errorMessages["comments"] != null) ...[ if (errorMessages["comments"] != null) ...[
SizedBox(height: 5), // Space before error message SizedBox(height: 5), // Space before error message
Text( Text("Required", style: TextStyle(color: Colors.red, fontSize: 12)),
"Required",
style: TextStyle(color: Colors.red, fontSize: 12),
),
], ],
], ],
), ),
if (isDesktop) Spacer(), if (isDesktop) Spacer(),
SizedBox( SizedBox(height: 5),
height: 5,
),
Row( Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: _handleAction(isDesktop), children: _handleAction(isDesktop),
@ -338,9 +346,7 @@ class _MiscellaneousScreenState extends State<MiscellaneousScreen> {
}, },
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
backgroundColor: Colors.grey[400], // Light grey color backgroundColor: Colors.grey[400], // Light grey color
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
borderRadius: BorderRadius.circular(8),
),
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 12), padding: EdgeInsets.symmetric(horizontal: 20, vertical: 12),
), ),
child: Text( child: Text(
@ -349,7 +355,6 @@ class _MiscellaneousScreenState extends State<MiscellaneousScreen> {
), ),
), ),
SizedBox(width: 10), // Space between buttons SizedBox(width: 10), // Space between buttons
// Save Changes Button // Save Changes Button
ElevatedButton( ElevatedButton(
onPressed: () { onPressed: () {
@ -357,9 +362,7 @@ class _MiscellaneousScreenState extends State<MiscellaneousScreen> {
}, },
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
backgroundColor: Color(0xFF114D8B), // Primary color for save backgroundColor: Color(0xFF114D8B), // Primary color for save
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
borderRadius: BorderRadius.circular(8),
),
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 12), padding: EdgeInsets.symmetric(horizontal: 20, vertical: 12),
), ),
child: Text( child: Text(

View File

@ -219,7 +219,7 @@ class _TaxiScreenState extends State<TaxiScreen> {
child: Column( child: Column(
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.all(28.0), padding: const EdgeInsets.only(top: 30.0),
child: Center( child: Center(
child: Column(children: _buildAccomadtionForm(isDesktop)), child: Column(children: _buildAccomadtionForm(isDesktop)),
), ),
@ -516,7 +516,6 @@ class _TaxiScreenState extends State<TaxiScreen> {
pickedTime.minute, pickedTime.minute,
); );
final isToday = final isToday =
selectedDate.year == now.year && selectedDate.year == now.year &&
selectedDate.month == now.month && selectedDate.month == now.month &&
@ -531,17 +530,24 @@ class _TaxiScreenState extends State<TaxiScreen> {
_timeController.text = ""; // Clear text field _timeController.text = ""; // Clear text field
}); });
return; return;
}else{ setState(() { } else {
setState(() {
_selectedCheckOutTime = pickedTime; _selectedCheckOutTime = pickedTime;
// Formatting time to HH:mm (24-hour format) // Formatting time to HH:mm (24-hour format)
final now = DateTime.now(); final now = DateTime.now();
final formattedTime = DateFormat('HH:mm').format( final formattedTime = DateFormat('HH:mm').format(
DateTime(now.year, now.month, now.day, pickedTime.hour, DateTime(
pickedTime.minute), now.year,
now.month,
now.day,
pickedTime.hour,
pickedTime.minute,
),
); );
errorMessages["time"] = ""; errorMessages["time"] = "";
_timeController.text = formattedTime; _timeController.text = formattedTime;
}); } });
}
} }
} }
@ -713,7 +719,10 @@ class _TaxiScreenState extends State<TaxiScreen> {
child: SizedBox( child: SizedBox(
height: 40, height: 40,
child: GestureDetector( child: GestureDetector(
onTap: () => _selectCheckOutTime(context), onTap: () {
_timeController.text = "";
_selectCheckOutTime(context);
},
child: AbsorbPointer( child: AbsorbPointer(
child: TextField( child: TextField(
focusNode: _timeFocusNode, focusNode: _timeFocusNode,
@ -739,7 +748,10 @@ class _TaxiScreenState extends State<TaxiScreen> {
if (errorMessages["time"] != null) ...[ if (errorMessages["time"] != null) ...[
SizedBox(height: 5), // Space before error message SizedBox(height: 5), // Space before error message
// Text("Required", style: TextStyle(color: Colors.red, fontSize: 12)), // Text("Required", style: TextStyle(color: Colors.red, fontSize: 12)),
Text(errorMessages["time"]!, style: TextStyle(color: Colors.red, fontSize: 12)), Text(
errorMessages["time"]!,
style: TextStyle(color: Colors.red, fontSize: 12),
),
], ],
], ],
), ),

View File

@ -324,7 +324,7 @@ class _TrainScreenState extends State<TrainScreen> {
// height: 6, // height: 6,
// ), // ),
Padding( Padding(
padding: const EdgeInsets.all(28.0), padding: const EdgeInsets.only(top: 30.0),
child: Center( child: Center(
child: Column(children: _buildAccomadtionForm(isDesktop)), child: Column(children: _buildAccomadtionForm(isDesktop)),
), ),

View File

@ -18,14 +18,15 @@ class VisaScreen extends StatefulWidget {
final Map<String, dynamic>? selectedItem; final Map<String, dynamic>? selectedItem;
final String? loginUser; final String? loginUser;
VisaScreen( VisaScreen({
{required this.onClose, required this.onClose,
required this.onSaveVisa, required this.onSaveVisa,
this.apiData, this.apiData,
required this.selectedItem, required this.selectedItem,
required this.apiCountryData, required this.apiCountryData,
required this.loginUser, required this.loginUser,
required this.flightData}); required this.flightData,
});
@override @override
_VisaScreenState createState() => _VisaScreenState(); _VisaScreenState createState() => _VisaScreenState();
@ -99,14 +100,18 @@ class _VisaScreenState extends State<VisaScreen> {
_addFocusListener(_tripTypeFocusNode, (focus) => _tripTypeFocused = focus); _addFocusListener(_tripTypeFocusNode, (focus) => _tripTypeFocused = focus);
_addFocusListener( _addFocusListener(
_hotelNameFocusNode, (focus) => _isHotelNameFocused = focus); _hotelNameFocusNode,
(focus) => _isHotelNameFocused = focus,
);
_addFocusListener(_dateFocusNode, (focus) => _dateFocus = focus); _addFocusListener(_dateFocusNode, (focus) => _dateFocus = focus);
_addFocusListener(_commentsFocusNode, (focus) => _commentsFocus = focus); _addFocusListener(_commentsFocusNode, (focus) => _commentsFocus = focus);
_visaCommentsController = _visaCommentsController = TextEditingController(
TextEditingController(text: widget.selectedItem?["comments"] ?? ""); text: widget.selectedItem?["comments"] ?? "",
_dateController = );
TextEditingController(text: widget.selectedItem?["start_date"] ?? ""); _dateController = TextEditingController(
text: widget.selectedItem?["start_date"] ?? "",
);
// Set the selected value if available // Set the selected value if available
if (widget.selectedItem != null && if (widget.selectedItem != null &&
@ -130,8 +135,9 @@ class _VisaScreenState extends State<VisaScreen> {
// Only set controller after value is updated // Only set controller after value is updated
// final parsedDate = // final parsedDate =
// DateTime.tryParse(flightFirstTripDateNotifier.value ?? ''); // DateTime.tryParse(flightFirstTripDateNotifier.value ?? '');
final parsedDate = DateFormat("dd-MM-yyyy") final parsedDate = DateFormat(
.parse(flightFirstTripDateNotifier.value ?? ''); "dd-MM-yyyy",
).parse(flightFirstTripDateNotifier.value ?? '');
if (parsedDate != null) { if (parsedDate != null) {
_dateController.text = DateFormat('dd-MM-yyyy').format(parsedDate); _dateController.text = DateFormat('dd-MM-yyyy').format(parsedDate);
} }
@ -181,17 +187,16 @@ class _VisaScreenState extends State<VisaScreen> {
} }
Map<String, String?> getFlightTripDateRange( Map<String, String?> getFlightTripDateRange(
List<Map<String, dynamic>> flightData) { List<Map<String, dynamic>> flightData,
final allTrips = flightData ) {
final allTrips =
flightData
.expand((flight) => flight['trips'] ?? []) .expand((flight) => flight['trips'] ?? [])
.whereType<Map<String, dynamic>>() .whereType<Map<String, dynamic>>()
.toList(); .toList();
if (allTrips.isEmpty) { if (allTrips.isEmpty) {
return { return {'firstTripDate': null, 'lastTripDate': null};
'firstTripDate': null,
'lastTripDate': null,
};
} }
allTrips.sort((a, b) { allTrips.sort((a, b) {
@ -229,7 +234,7 @@ class _VisaScreenState extends State<VisaScreen> {
List<String> requiredFields = [ List<String> requiredFields = [
"type_of_visa", "type_of_visa",
"country_code", "country_code",
"start_date" "start_date",
]; ];
// Check validation for each field // Check validation for each field
@ -260,9 +265,11 @@ class _VisaScreenState extends State<VisaScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ResponsiveBuilder(builder: (context, sizingInfo) { return ResponsiveBuilder(
builder: (context, sizingInfo) {
bool isMobile = sizingInfo.isMobile; bool isMobile = sizingInfo.isMobile;
bool isDesktop = sizingInfo.deviceScreenType == DeviceScreenType.desktop; bool isDesktop =
sizingInfo.deviceScreenType == DeviceScreenType.desktop;
return Container( return Container(
child: Form( child: Form(
@ -272,17 +279,18 @@ class _VisaScreenState extends State<VisaScreen> {
child: Column( child: Column(
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.all(28.0), padding: const EdgeInsets.only(top: 30.0),
child: Center( child: Center(
child: Column(children: _buildAccomadtionForm(isDesktop)), child: Column(children: _buildAccomadtionForm(isDesktop)),
), ),
) ),
], ],
), ),
), ),
), ),
); );
}); },
);
} }
List<Widget> _buildAccomadtionForm(bool isDesktop) { List<Widget> _buildAccomadtionForm(bool isDesktop) {
@ -308,14 +316,7 @@ class _VisaScreenState extends State<VisaScreen> {
} }
List<Widget> _buildFirstRow(isDesktop) { List<Widget> _buildFirstRow(isDesktop) {
return [ return [if (isDesktop) Spacer() else SizedBox(height: 8)];
if (isDesktop)
Spacer()
else
SizedBox(
height: 8,
),
];
} }
List<Widget> _buildTripType(bool isDesktop) { List<Widget> _buildTripType(bool isDesktop) {
@ -354,7 +355,7 @@ class _VisaScreenState extends State<VisaScreen> {
// Map country codes to country names // Map country codes to country names
countryMap = { countryMap = {
for (var item in countryList) for (var item in countryList)
item['country_code'] as String: item['country_name'] as String item['country_code'] as String: item['country_name'] as String,
}; };
// Extract only country codes for processing // Extract only country codes for processing
@ -417,19 +418,24 @@ class _VisaScreenState extends State<VisaScreen> {
List<dynamic> purposeList = widget.apiData?['visa_type_of_visa'] ?? []; List<dynamic> purposeList = widget.apiData?['visa_type_of_visa'] ?? [];
List<DropdownMenuItem<String>> dropdownItems = purposeList List<DropdownMenuItem<String>> dropdownItems =
.map((item) => DropdownMenuItem<String>( purposeList
.map(
(item) => DropdownMenuItem<String>(
value: item['dropdown_key'], value: item['dropdown_key'],
child: Text(item['dropdown_value']), child: Text(item['dropdown_value']),
)) ),
)
.toList(); .toList();
if (dropdownItems.isEmpty) { if (dropdownItems.isEmpty) {
dropdownItems.add( dropdownItems.add(
DropdownMenuItem<String>( DropdownMenuItem<String>(
value: null, value: null,
child: Text("No options available", child: Text(
style: TextStyle(color: Colors.grey)), "No options available",
style: TextStyle(color: Colors.grey),
),
), ),
); );
} }
@ -438,7 +444,6 @@ class _VisaScreenState extends State<VisaScreen> {
selectedPurpose ??= selectedPurpose ??=
dropdownItems.isNotEmpty ? dropdownItems.first.value : null; dropdownItems.isNotEmpty ? dropdownItems.first.value : null;
return [ return [
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -447,14 +452,16 @@ class _VisaScreenState extends State<VisaScreen> {
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: 12, fontSize: 12,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: Color(0xFF575A74)), color: Color(0xFF575A74),
),
), ),
SizedBox(height: 5), SizedBox(height: 5),
CustomTextFieldWrapper( CustomTextFieldWrapper(
isFocused: _isHotelNameFocused, isFocused: _isHotelNameFocused,
isDesktop: isDesktop, isDesktop: isDesktop,
// width: isDesktop ? MediaQuery.of(context).size.width * 0.15 : null, // width: isDesktop ? MediaQuery.of(context).size.width * 0.15 : null,
width: isDesktop width:
isDesktop
? MediaQuery.of(context).size.width * 0.34 ? MediaQuery.of(context).size.width * 0.34
: MediaQuery.of(context).size.width * 0.66, : MediaQuery.of(context).size.width * 0.66,
child: SizedBox( child: SizedBox(
@ -474,12 +481,11 @@ class _VisaScreenState extends State<VisaScreen> {
dropdownDecoratorProps: DropDownDecoratorProps( dropdownDecoratorProps: DropDownDecoratorProps(
dropdownSearchDecoration: InputDecoration( dropdownSearchDecoration: InputDecoration(
border: InputBorder.none, border: InputBorder.none,
contentPadding: EdgeInsets.symmetric( contentPadding: EdgeInsets.symmetric(horizontal: 1),
horizontal: 1,
), ),
), ),
), dropdownBuilder:
dropdownBuilder: (context, selectedItem) => Align( (context, selectedItem) => Align(
// Center-align selected item // Center-align selected item
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
child: Text( child: Text(
@ -490,7 +496,8 @@ class _VisaScreenState extends State<VisaScreen> {
onChanged: (String? newValue) { onChanged: (String? newValue) {
setState(() { setState(() {
// Find the country_code based on selected country_name // Find the country_code based on selected country_name
selectedCountry = countryMap.entries selectedCountry =
countryMap.entries
.firstWhere((entry) => entry.value == newValue) .firstWhere((entry) => entry.value == newValue)
.key; .key;
@ -504,20 +511,12 @@ class _VisaScreenState extends State<VisaScreen> {
), ),
if (errorMessages["country_code"] != null) ...[ if (errorMessages["country_code"] != null) ...[
SizedBox(height: 5), // Space before error message SizedBox(height: 5), // Space before error message
Text( Text("Required", style: TextStyle(color: Colors.red, fontSize: 12)),
"Required",
style: TextStyle(color: Colors.red, fontSize: 12),
),
], ],
], ],
), ),
if (isDesktop) if (isDesktop) Spacer() else SizedBox(height: 8),
Spacer()
else
SizedBox(
height: 8,
),
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -526,7 +525,8 @@ class _VisaScreenState extends State<VisaScreen> {
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: 12, fontSize: 12,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: Color(0xFF575A74)), color: Color(0xFF575A74),
),
), ),
SizedBox(height: 5), SizedBox(height: 5),
CustomTextFieldWrapper( CustomTextFieldWrapper(
@ -544,16 +544,19 @@ class _VisaScreenState extends State<VisaScreen> {
style: TextStyle(fontSize: 12), style: TextStyle(fontSize: 12),
decoration: InputDecoration( decoration: InputDecoration(
border: InputBorder.none, border: InputBorder.none,
contentPadding: contentPadding: EdgeInsets.symmetric(
EdgeInsets.symmetric(horizontal: 10), // Proper padding horizontal: 10,
), // Proper padding
), ),
onChanged: purposeList.isNotEmpty onChanged:
purposeList.isNotEmpty
? (newValue) { ? (newValue) {
setState(() { setState(() {
selectedPurpose = newValue; selectedPurpose = newValue;
}); });
print( print(
"Updating form data: Flight -> trip_type -> ${newValue ?? ""}"); "Updating form data: Flight -> trip_type -> ${newValue ?? ""}",
);
} }
: null, : null,
@ -563,19 +566,11 @@ class _VisaScreenState extends State<VisaScreen> {
), ),
if (errorMessages["type_of_visa"] != null) ...[ if (errorMessages["type_of_visa"] != null) ...[
SizedBox(height: 5), // Space before error message SizedBox(height: 5), // Space before error message
Text( Text("Required", style: TextStyle(color: Colors.red, fontSize: 12)),
"Required",
style: TextStyle(color: Colors.red, fontSize: 12),
),
], ],
], ],
), ),
if (isDesktop) if (isDesktop) Spacer() else SizedBox(height: 8),
Spacer()
else
SizedBox(
height: 8,
),
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -584,7 +579,8 @@ class _VisaScreenState extends State<VisaScreen> {
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: 12, fontSize: 12,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: Color(0xFF575A74)), color: Color(0xFF575A74),
),
), ),
SizedBox(height: 5), SizedBox(height: 5),
CustomTextFieldWrapper( CustomTextFieldWrapper(
@ -613,8 +609,11 @@ class _VisaScreenState extends State<VisaScreen> {
floatingLabelBehavior: FloatingLabelBehavior.never, floatingLabelBehavior: FloatingLabelBehavior.never,
border: InputBorder.none, border: InputBorder.none,
contentPadding: EdgeInsets.symmetric(vertical: 16), contentPadding: EdgeInsets.symmetric(vertical: 16),
suffixIcon: Icon(Icons.calendar_today, suffixIcon: Icon(
size: 16, color: Colors.grey), Icons.calendar_today,
size: 16,
color: Colors.grey,
),
), ),
), ),
), ),
@ -623,10 +622,7 @@ class _VisaScreenState extends State<VisaScreen> {
), ),
if (errorMessages["start_date"] != null) ...[ if (errorMessages["start_date"] != null) ...[
SizedBox(height: 5), // Space before error message SizedBox(height: 5), // Space before error message
Text( Text("Required", style: TextStyle(color: Colors.red, fontSize: 12)),
"Required",
style: TextStyle(color: Colors.red, fontSize: 12),
),
], ],
], ],
), ),
@ -643,13 +639,15 @@ class _VisaScreenState extends State<VisaScreen> {
style: GoogleFonts.poppins( style: GoogleFonts.poppins(
fontSize: 12, fontSize: 12,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: Color(0xFF575A74)), color: Color(0xFF575A74),
),
), ),
SizedBox(height: 5), SizedBox(height: 5),
CustomTextFieldWrapper( CustomTextFieldWrapper(
isFocused: _commentsFocus, // Dropdown doesn't use focus isFocused: _commentsFocus, // Dropdown doesn't use focus
isDesktop: isDesktop, isDesktop: isDesktop,
width: isDesktop width:
isDesktop
? MediaQuery.of(context).size.width * 0.34 ? MediaQuery.of(context).size.width * 0.34
: MediaQuery.of(context).size.width * 0.66, : MediaQuery.of(context).size.width * 0.66,
child: SizedBox( child: SizedBox(
@ -671,9 +669,7 @@ class _VisaScreenState extends State<VisaScreen> {
], ],
), ),
if (isDesktop) Spacer(), if (isDesktop) Spacer(),
SizedBox( SizedBox(height: 5),
height: 5,
),
Column( Column(
children: [ children: [
Row( Row(
@ -694,9 +690,7 @@ class _VisaScreenState extends State<VisaScreen> {
}, },
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
backgroundColor: Colors.grey[400], // Light grey color backgroundColor: Colors.grey[400], // Light grey color
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
borderRadius: BorderRadius.circular(8),
),
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 12), padding: EdgeInsets.symmetric(horizontal: 20, vertical: 12),
), ),
child: Text( child: Text(
@ -705,7 +699,6 @@ class _VisaScreenState extends State<VisaScreen> {
), ),
), ),
SizedBox(width: 10), // Space between buttons SizedBox(width: 10), // Space between buttons
// Save Changes Button // Save Changes Button
ElevatedButton( ElevatedButton(
onPressed: () { onPressed: () {
@ -713,9 +706,7 @@ class _VisaScreenState extends State<VisaScreen> {
}, },
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
backgroundColor: Color(0xFF114D8B), // Primary color for save backgroundColor: Color(0xFF114D8B), // Primary color for save
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
borderRadius: BorderRadius.circular(8),
),
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 12), padding: EdgeInsets.symmetric(horizontal: 20, vertical: 12),
), ),
child: Text( child: Text(

View File

@ -903,10 +903,15 @@ class CreateNewPlansState extends State<CreateNewPlan> {
setState(() { setState(() {
apiCostData = plansJson; apiCostData = plansJson;
print("apiCostData...1");
costCenterMap = { costCenterMap = {
for (var item in apiCostData!) for (var item in apiCostData!)
// item['department_id'].toString(): item['name'].toString(),
item['cost_center_id'].toString(): item['name'].toString(), item['cost_center_id'].toString(): item['name'].toString(),
}; };
print("apiCostData...122");
costCenterIds = costCenterMap.keys.toList(); costCenterIds = costCenterMap.keys.toList();
// Optionally auto-select the first item if not already selected // Optionally auto-select the first item if not already selected
@ -1030,8 +1035,9 @@ class CreateNewPlansState extends State<CreateNewPlan> {
// Handle Submit // Handle Submit
bool validateForm() { bool validateForm() {
print("validateForm");
validationErrors.clear(); // Clear previous errors validationErrors.clear(); // Clear previous errors
print("validateForm.....1");
// Ensure either "user_id" or "traveller_id" is provided // Ensure either "user_id" or "traveller_id" is provided
if ((planUsrId == null || planUsrId!.isEmpty) && if ((planUsrId == null || planUsrId!.isEmpty) &&
(planTravlrId == null || planTravlrId!.isEmpty)) { (planTravlrId == null || planTravlrId!.isEmpty)) {
@ -1040,7 +1046,7 @@ class CreateNewPlansState extends State<CreateNewPlan> {
validationErrors["traveller_id"] = validationErrors["traveller_id"] =
"Either User ID or Traveller ID is required"; "Either User ID or Traveller ID is required";
} }
print("validateForm.....2");
final requiredFields = { final requiredFields = {
if (TripPlanAction != "Plan Creation Not Allowed") // if (TripPlanAction != "Plan Creation Not Allowed") //
"trip_type": _selectedTripType, "trip_type": _selectedTripType,
@ -1049,14 +1055,14 @@ class CreateNewPlansState extends State<CreateNewPlan> {
"functional_department": selectedFuncDept, "functional_department": selectedFuncDept,
"purpose_of_travel": selectedPurpose, "purpose_of_travel": selectedPurpose,
}; };
print("validateForm.....3");
for (var entry in requiredFields.entries) { for (var entry in requiredFields.entries) {
if (entry.value == null || entry.value!.isEmpty) { if (entry.value == null || entry.value!.isEmpty) {
validationErrors[entry.key] = "Required"; validationErrors[entry.key] = "Required";
// "${entry.key.replaceAll('_', ' ').toUpperCase()} Required"; // "${entry.key.replaceAll('_', ' ').toUpperCase()} Required";
} }
} }
print("validateForm.....1");
// Validate at least one service is selected // Validate at least one service is selected
final serviceLists = [ final serviceLists = [
flightList, flightList,
@ -1179,7 +1185,9 @@ class CreateNewPlansState extends State<CreateNewPlan> {
void handleSubmit() { void handleSubmit() {
setState(() async { setState(() async {
print("Hansle Submit....11");
if (validateForm() && temporaryMessage == null) { if (validateForm() && temporaryMessage == null) {
print("Hansle Submit....11222");
// if (selectedPlanId != null && selectedPlanId!.isNotEmpty) { // if (selectedPlanId != null && selectedPlanId!.isNotEmpty) {
// planData['plan_id'] = selectedPlanId; // Add plan_id for update // planData['plan_id'] = selectedPlanId; // Add plan_id for update
// } // }
@ -1251,6 +1259,26 @@ class CreateNewPlansState extends State<CreateNewPlan> {
} else { } else {
print("Failed to submit plan. Status: ${response.statusCode}"); print("Failed to submit plan. Status: ${response.statusCode}");
print("Error: ${response.body}"); print("Error: ${response.body}");
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: Text("Trip Creation Failed"),
content: Text(
"There was a problem submitting your plan. Please try again.",
),
actions: [
TextButton(
child: Text("OK"),
onPressed: () {
Navigator.of(context).pop();
},
),
],
);
},
);
} }
} catch (e) { } catch (e) {
print(" Error submitting plan: $e"); print(" Error submitting plan: $e");

View File

@ -101,6 +101,12 @@ class DynamicItineraryState extends State<DynamicItinerary> {
super.didChangeDependencies(); super.didChangeDependencies();
if (widget.tripType != _tripType) { if (widget.tripType != _tripType) {
// setState(() {
// selectedOption = "";
// isSelected = false;
// selectedIndex = null;
// selectedItem = null;
// });
updateTripType(widget.tripType); updateTripType(widget.tripType);
} }
} }