UI_HOTEL_NAME_ALIGN

This commit is contained in:
venbaittech 2025-08-06 11:10:39 +05:30
parent bf9a2b1277
commit 005f526798
5 changed files with 232 additions and 185 deletions

View File

@ -653,7 +653,7 @@ class _AccomodationScreenState extends State<AccomodationScreen> {
isDesktop: isDesktop,
width:
isDesktop
? MediaQuery.of(context).size.width * 0.34
? MediaQuery.of(context).size.width * 0.35
: null, //MediaQuery.of(context).size.width * 0.66,
child: SizedBox(
height: 40,
@ -720,6 +720,8 @@ class _AccomodationScreenState extends State<AccomodationScreen> {
items: allItems,
selectedItem: _hotelNameController.text,
popupProps: PopupProps.menu(
fit: FlexFit.loose,
constraints: BoxConstraints(maxHeight: 220),
menuProps: const MenuProps(backgroundColor: Colors.white),
showSearchBox: true,
itemBuilder:
@ -738,6 +740,7 @@ class _AccomodationScreenState extends State<AccomodationScreen> {
),
searchFieldProps: TextFieldProps(
controller: _hotelNameController,
style: TextStyle(fontSize: 11),
decoration: InputDecoration(
labelText: "Enter/ Search Hotel Name",
labelStyle: GoogleFonts.poppins(fontSize: 11),
@ -751,8 +754,28 @@ class _AccomodationScreenState extends State<AccomodationScreen> {
border: OutlineInputBorder(),
),
),
fit: FlexFit.loose,
),
dropdownBuilder: (context, selectedItem) {
if (selectedItem == null || selectedItem.isEmpty) {
return Text(
"Select ",
style: GoogleFonts.poppins(
color: Colors.grey,
fontSize: 12,
fontWeight: FontWeight.w400,
),
);
}
return Text(
selectedItem ?? '',
semanticsLabel: "hotelName",
style: GoogleFonts.roboto(
fontSize: 11,
fontWeight: FontWeight.w400,
color: Colors.black,
),
);
},
dropdownDecoratorProps: DropDownDecoratorProps(
dropdownSearchDecoration: InputDecoration(
@ -778,7 +801,7 @@ class _AccomodationScreenState extends State<AccomodationScreen> {
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color:
(_CategoryFocused ?? false)
(_isHotelNameFocused ?? false)
? layoutColor
: Colors.white,
// : const Color(0xFFD6D5E6),
@ -949,7 +972,7 @@ class _AccomodationScreenState extends State<AccomodationScreen> {
return Text(
selectedItem['dropdown_value'] ?? '',
style: GoogleFonts.poppins(
fontSize: 12,
fontSize: 11,
// color: Colors.red,
color: Colors.black,
),
@ -1470,7 +1493,7 @@ class _AccomodationScreenState extends State<AccomodationScreen> {
isDesktop: isDesktop,
width:
isDesktop
? MediaQuery.of(context).size.width * 0.34
? MediaQuery.of(context).size.width * 0.35
: null, // MediaQuery.of(context).size.width * 0.66,
child: SizedBox(
height: 40,

View File

@ -650,7 +650,7 @@ class _BusScreenState extends State<BusScreen> {
CustomTextFieldItnerarySubWrapper(
isFocused: _commentsFocus, // Dropdown doesn't use focus
isDesktop: isDesktop,
width: isDesktop ? MediaQuery.of(context).size.width * 0.34 : null,
width: isDesktop ? MediaQuery.of(context).size.width * 0.35 : null,
child: SizedBox(
height: 40,
child: TextField(

View File

@ -160,9 +160,9 @@ class _TaxiScreenState extends State<TaxiScreen> {
setState(() {
layoutColor =
layoutString != null
? Color(int.parse(layoutString))
: Colors.redAccent;
layoutString != null
? Color(int.parse(layoutString))
: Colors.redAccent;
});
}
@ -434,95 +434,99 @@ class _TaxiScreenState extends State<TaxiScreen> {
// Request focus when user taps
_carTypeFocusNode?.requestFocus();
},
child: DropdownSearch<Map<String, dynamic>>(
// focusNode: _taxiReqFocusNode,
items: purposeList.cast<Map<String, dynamic>>(),
selectedItem: purposeList.firstWhere(
(item) => item['dropdown_key'] == selectedCarType,
orElse: () => {},
),
itemAsString: (item) => item['dropdown_value'] ?? '',
popupProps: PopupProps.menu(
showSearchBox: false,
fit: FlexFit.loose,
menuProps: const MenuProps(backgroundColor: Colors.white),
itemBuilder: (context, item, isSelected) {
return Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
child: DropdownSearch<Map<String, dynamic>>(
// focusNode: _taxiReqFocusNode,
items: purposeList.cast<Map<String, dynamic>>(),
selectedItem: purposeList.firstWhere(
(item) => item['dropdown_key'] == selectedCarType,
orElse: () => {},
),
itemAsString: (item) => item['dropdown_value'] ?? '',
popupProps: PopupProps.menu(
showSearchBox: false,
fit: FlexFit.loose,
menuProps: const MenuProps(backgroundColor: Colors.white),
itemBuilder: (context, item, isSelected) {
return Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
child: Text(
item['dropdown_value'] ?? '',
style: GoogleFonts.poppins(
fontSize: 12,
color: Colors.black,
),
),
);
},
),
dropdownDecoratorProps: DropDownDecoratorProps(
dropdownSearchDecoration: InputDecoration(
// border: InputBorder.none,
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(5),
borderSide: BorderSide(
color:
(_carTypeFocused ?? false)
? layoutColor!
: Colors.white,
width: 1,
),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color:
(_carTypeFocused ?? false)
? layoutColor
: Colors.white,
// : const Color(0xFFD6D5E6),
width: 1,
// const Color(0xFFD6D5E6),
),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: layoutColor, width: 1),
),
contentPadding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
),
child: Text(
item['dropdown_value'] ?? '',
),
dropdownBuilder: (context, selectedItem) {
if (selectedItem == null || selectedItem.isEmpty) {
return Text(
"Select ",
style: GoogleFonts.poppins(
color: Colors.grey,
fontSize: 13,
),
);
}
return Text(
selectedItem['dropdown_value'] ?? '',
style: GoogleFonts.poppins(
fontSize: 12,
color: Colors.black,
),
),
);
},
),
dropdownDecoratorProps: DropDownDecoratorProps(
dropdownSearchDecoration: InputDecoration(
// border: InputBorder.none,
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(5),
borderSide: BorderSide(
color:
(_carTypeFocused ?? false)
? layoutColor!
: Colors.white,
width: 1,
),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color:
(_carTypeFocused ?? false)
? layoutColor
: Colors.white,
// : const Color(0xFFD6D5E6),
width: 1,
// const Color(0xFFD6D5E6),
),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: layoutColor, width: 1),
),
contentPadding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
);
},
onChanged:
purposeList.isNotEmpty
? (newValue) {
setState(() {
selectedCarType = newValue as String?;
});
print(
"Updating form data: -> ${newValue ?? ""}",
);
}
: null,
),
),
dropdownBuilder: (context, selectedItem) {
if (selectedItem == null || selectedItem.isEmpty) {
return Text(
"Select ",
style: GoogleFonts.poppins(
color: Colors.grey,
fontSize: 13,
),
);
}
return Text(
selectedItem['dropdown_value'] ?? '',
style: GoogleFonts.poppins(
fontSize: 12,
color: Colors.black,
),
);
},
onChanged:
purposeList.isNotEmpty
? (newValue) {
setState(() {
selectedCarType = newValue as String?;
});
print("Updating form data: -> ${newValue ?? ""}");
}
: null,
),),),
),
),
),
],
@ -602,105 +606,113 @@ class _TaxiScreenState extends State<TaxiScreen> {
padding: const EdgeInsets.symmetric(horizontal: 0),
width:
isDesktop
? MediaQuery.of(context).size.width * 0.34
: null,//MediaQuery.of(context).size.width * 0.66,
? MediaQuery.of(context).size.width * 0.35
: null, //MediaQuery.of(context).size.width * 0.66,
child: SizedBox(
height: 40,
width: double.infinity,
child: Focus(
focusNode: _taxiReqFocusNode,
onFocusChange: (hasFocus) {
setState(() {
_taxiReqFocused = hasFocus;
});
},
child: GestureDetector(
onTap: () {
_taxiReqFocusNode?.requestFocus();
setState(() {
_taxiReqFocused = hasFocus;
});
},
child: DropdownSearch<Map<String, dynamic>>(
// focusNode: _taxiReqFocusNode,
items: purposeList.cast<Map<String, dynamic>>(),
selectedItem: purposeList.firstWhere(
(item) => item['dropdown_key'] == selectedReqTaxi,
orElse: () => {},
),
itemAsString: (item) => item['dropdown_value'] ?? '',
popupProps: PopupProps.menu(
showSearchBox: false,
fit: FlexFit.loose,
menuProps: const MenuProps(backgroundColor: Colors.white),
itemBuilder: (context, item, isSelected) {
return Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
child: GestureDetector(
onTap: () {
_taxiReqFocusNode?.requestFocus();
},
child: DropdownSearch<Map<String, dynamic>>(
// focusNode: _taxiReqFocusNode,
items: purposeList.cast<Map<String, dynamic>>(),
selectedItem: purposeList.firstWhere(
(item) => item['dropdown_key'] == selectedReqTaxi,
orElse: () => {},
),
itemAsString: (item) => item['dropdown_value'] ?? '',
popupProps: PopupProps.menu(
showSearchBox: false,
fit: FlexFit.loose,
menuProps: const MenuProps(backgroundColor: Colors.white),
itemBuilder: (context, item, isSelected) {
return Padding(
padding: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
child: Text(
item['dropdown_value'] ?? '',
style: GoogleFonts.poppins(
fontSize: 12,
color: Colors.black,
),
),
);
},
),
dropdownDecoratorProps: DropDownDecoratorProps(
dropdownSearchDecoration: InputDecoration(
// border: InputBorder.none,
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(5),
borderSide: BorderSide(
color:
(_taxiReqFocused ?? false)
? layoutColor!
: Colors.white,
width: 1,
),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color:
(_taxiReqFocused ?? false)
? layoutColor
: Colors.white,
// : const Color(0xFFD6D5E6),
width: 1,
// const Color(0xFFD6D5E6),
),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: layoutColor, width: 1),
),
contentPadding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 1,
),
),
child: Text(
item['dropdown_value'] ?? '',
),
dropdownBuilder: (context, selectedItem) {
if (selectedItem == null || selectedItem.isEmpty) {
return Text(
"Select ",
style: GoogleFonts.poppins(
color: Colors.grey,
fontSize: 13,
),
);
}
return Text(
selectedItem['dropdown_value'] ?? '',
style: GoogleFonts.poppins(
fontSize: 12,
color: Colors.black,
),
),
);
},
),
dropdownDecoratorProps: DropDownDecoratorProps(
dropdownSearchDecoration: InputDecoration(
// border: InputBorder.none,
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(5),
borderSide: BorderSide(
color:
(_taxiReqFocused ?? false)
? layoutColor!
: Colors.white,
width: 1,
),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color:
(_taxiReqFocused ?? false)
? layoutColor
: Colors.white,
// : const Color(0xFFD6D5E6),
width: 1,
// const Color(0xFFD6D5E6),
),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: layoutColor, width: 1),
),
contentPadding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 1,
),
);
},
onChanged:
purposeList.isNotEmpty
? (newValue) {
setState(() {
selectedReqTaxi = newValue as String?;
});
print("Updating form data: -> ${newValue ?? ""}");
}
: null,
),
),
dropdownBuilder: (context, selectedItem) {
if (selectedItem == null || selectedItem.isEmpty) {
return Text(
"Select ",
style: GoogleFonts.poppins(color: Colors.grey, fontSize: 13),
);
}
return Text(
selectedItem['dropdown_value'] ?? '',
style: GoogleFonts.poppins(fontSize: 12, color: Colors.black),
);
},
onChanged:
purposeList.isNotEmpty
? (newValue) {
setState(() {
selectedReqTaxi = newValue as String?;
});
print("Updating form data: -> ${newValue ?? ""}");
}
: null,
),),),
),
),
),
];
@ -1024,8 +1036,8 @@ class _TaxiScreenState extends State<TaxiScreen> {
isDesktop: isDesktop,
width:
isDesktop
? MediaQuery.of(context).size.width * 0.34
: null,//MediaQuery.of(context).size.width * 0.66,
? MediaQuery.of(context).size.width * 0.35
: null, //MediaQuery.of(context).size.width * 0.66,
child: SizedBox(
height: 40,

View File

@ -315,13 +315,16 @@ class _AccomodationListWidgetState extends State<AccomodationListWidget> {
Row(
// mainAxisAlignment: MainAxisAlignment.end,
children: [
Text(
item["hotel_name"]!,
style: GoogleFonts.poppins(
fontSize: 14,
fontWeight:
isDesktop ? FontWeight.w800 : FontWeight.w600,
color: !isDesktop ? Colors.black : Color(0xFF575A74),
Expanded(
flex: 1,
child: Text(
item["hotel_name"]!,
style: GoogleFonts.poppins(
fontSize: 14,
fontWeight:
isDesktop ? FontWeight.w800 : FontWeight.w600,
color: !isDesktop ? Colors.black : Color(0xFF575A74),
),
),
),
Spacer(),

View File

@ -831,6 +831,12 @@ class _CreateUserFormDetialsState extends State<CreateUserFormDetials> {
}
}
void closeLoaderIfOpen() {
if (mounted) {
Navigator.of(context, rootNavigator: true).pop();
}
}
void handleSubmit() async {
print("USR Detail Submit");
// printFormData();
@ -852,6 +858,7 @@ class _CreateUserFormDetialsState extends State<CreateUserFormDetials> {
if (!await isValidData(data)) {
print("USERDETAILS : $userDetials");
print("Validation Failed: Required fields are missing.");
closeLoaderIfOpen();
setState(() {});
return; // Stop execution if validation fails
} else {
@ -864,6 +871,7 @@ class _CreateUserFormDetialsState extends State<CreateUserFormDetials> {
print("isValid- $isValid");
if (!isValid) {
print("Validation failed. Please check the inputs.");
closeLoaderIfOpen();
setState(() {});
return; // STOP execution here if not valid
}
@ -967,6 +975,7 @@ class _CreateUserFormDetialsState extends State<CreateUserFormDetials> {
if (!await isValidData(data) && !await isValidDataTwo(data)) {
print("USERDETAILS : $userDetials");
print("Validation Failed: Required fields are missing.");
closeLoaderIfOpen();
setState(() {});
return; // Stop execution if validation fails
} else {