From 005f52679812f5aa74d529ace62fdaed468d39ca Mon Sep 17 00:00:00 2001 From: venbaittech Date: Wed, 6 Aug 2025 11:10:39 +0530 Subject: [PATCH] UI_HOTEL_NAME_ALIGN --- lib/Screens/itnerary/accomodations.dart | 33 +- lib/Screens/itnerary/bus.dart | 2 +- lib/Screens/itnerary/taxi.dart | 356 +++++++++--------- .../itnerary_list/accomodation_list.dart | 17 +- .../create_user/create_user.dart | 9 + 5 files changed, 232 insertions(+), 185 deletions(-) diff --git a/lib/Screens/itnerary/accomodations.dart b/lib/Screens/itnerary/accomodations.dart index b49c876..a080093 100644 --- a/lib/Screens/itnerary/accomodations.dart +++ b/lib/Screens/itnerary/accomodations.dart @@ -653,7 +653,7 @@ class _AccomodationScreenState extends State { 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 { 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 { ), 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 { 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 { enabledBorder: OutlineInputBorder( borderSide: BorderSide( color: - (_CategoryFocused ?? false) + (_isHotelNameFocused ?? false) ? layoutColor : Colors.white, // : const Color(0xFFD6D5E6), @@ -949,7 +972,7 @@ class _AccomodationScreenState extends State { 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 { 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, diff --git a/lib/Screens/itnerary/bus.dart b/lib/Screens/itnerary/bus.dart index 0b62071..ebc41d8 100644 --- a/lib/Screens/itnerary/bus.dart +++ b/lib/Screens/itnerary/bus.dart @@ -650,7 +650,7 @@ class _BusScreenState extends State { 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( diff --git a/lib/Screens/itnerary/taxi.dart b/lib/Screens/itnerary/taxi.dart index c0e5649..779dfd2 100644 --- a/lib/Screens/itnerary/taxi.dart +++ b/lib/Screens/itnerary/taxi.dart @@ -160,9 +160,9 @@ class _TaxiScreenState extends State { 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 { // Request focus when user taps _carTypeFocusNode?.requestFocus(); }, - child: DropdownSearch>( - // focusNode: _taxiReqFocusNode, - items: purposeList.cast>(), - 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>( + // focusNode: _taxiReqFocusNode, + items: purposeList.cast>(), + 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 { 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>( - // focusNode: _taxiReqFocusNode, - items: purposeList.cast>(), - 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>( + // focusNode: _taxiReqFocusNode, + items: purposeList.cast>(), + 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 { 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, diff --git a/lib/Screens/itnerary_list/accomodation_list.dart b/lib/Screens/itnerary_list/accomodation_list.dart index 0096465..45d38b5 100644 --- a/lib/Screens/itnerary_list/accomodation_list.dart +++ b/lib/Screens/itnerary_list/accomodation_list.dart @@ -315,13 +315,16 @@ class _AccomodationListWidgetState extends State { 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(), diff --git a/lib/Screens/userManagement/create_user/create_user.dart b/lib/Screens/userManagement/create_user/create_user.dart index 6465d1d..125a186 100644 --- a/lib/Screens/userManagement/create_user/create_user.dart +++ b/lib/Screens/userManagement/create_user/create_user.dart @@ -831,6 +831,12 @@ class _CreateUserFormDetialsState extends State { } } + 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 { 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 { 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 { 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 {