From 91f1e86afabb7ddafe390a87c9ef0d846e30b282 Mon Sep 17 00:00:00 2001 From: venba-Inspriron-3558 Date: Tue, 24 Jun 2025 18:17:30 +0530 Subject: [PATCH] minor issues fixes 4 --- lib/Screens/costCenter/costCenter_list.dart | 3 +- lib/Screens/department/department_list.dart | 3 +- lib/Screens/group/groupList.dart | 3 +- lib/Screens/hotels/hotels_list.dart | 4 +- lib/Screens/itnerary/flights.dart | 72 +++++++- lib/Screens/myTemplates/templatesList.dart | 3 +- lib/Screens/organization/mailSettings.dart | 155 +++++++++--------- lib/Screens/organization/orgSetup.dart | 126 ++++++++++---- lib/Screens/organization/themeColor.dart | 154 ++++++++++++----- lib/Screens/perdiem_amount/forexDetails.dart | 10 ++ lib/Screens/perdiem_amount/forex_list.dart | 3 +- lib/Screens/policy/policy_list.dart | 3 +- lib/Screens/traveller/travellerList.dart | 3 +- .../createTravelAgent.dart | 14 +- .../listTravelAgent.dart | 6 +- .../personalDetailsTravelAgent.dart | 21 ++- 16 files changed, 408 insertions(+), 175 deletions(-) diff --git a/lib/Screens/costCenter/costCenter_list.dart b/lib/Screens/costCenter/costCenter_list.dart index 9ff345e..a428070 100644 --- a/lib/Screens/costCenter/costCenter_list.dart +++ b/lib/Screens/costCenter/costCenter_list.dart @@ -308,7 +308,8 @@ class CostCenterListState extends State { ], ), if (isDesktop) - SizedBox(width: MediaQuery.of(context).size.width * 0.16), + SizedBox(width: MediaQuery.of(context).size.width * 0.08), + // SizedBox(width: MediaQuery.of(context).size.width * 0.16), if (isDesktop) Container( diff --git a/lib/Screens/department/department_list.dart b/lib/Screens/department/department_list.dart index 8766693..bf97295 100644 --- a/lib/Screens/department/department_list.dart +++ b/lib/Screens/department/department_list.dart @@ -307,7 +307,8 @@ class DepartmentListState extends State { ], ), if (isDesktop) - SizedBox(width: MediaQuery.of(context).size.width * 0.16), + SizedBox(width: MediaQuery.of(context).size.width * 0.08), + // SizedBox(width: MediaQuery.of(context).size.width * 0.16), if (isDesktop) Container( diff --git a/lib/Screens/group/groupList.dart b/lib/Screens/group/groupList.dart index bc3f5b1..35be928 100644 --- a/lib/Screens/group/groupList.dart +++ b/lib/Screens/group/groupList.dart @@ -327,7 +327,8 @@ class _GroupListState extends State { ], ), if (isDesktop) - SizedBox(width: MediaQuery.of(context).size.width * 0.28), + SizedBox(width: MediaQuery.of(context).size.width * 0.145), + // SizedBox(width: MediaQuery.of(context).size.width * 0.28), if (isDesktop) Container( diff --git a/lib/Screens/hotels/hotels_list.dart b/lib/Screens/hotels/hotels_list.dart index 7fd2bf1..0838d5f 100644 --- a/lib/Screens/hotels/hotels_list.dart +++ b/lib/Screens/hotels/hotels_list.dart @@ -358,8 +358,8 @@ class HotelsDataListState extends State { ], ), if (isDesktop) - SizedBox(width: MediaQuery.of(context).size.width * 0.16), - + SizedBox(width: MediaQuery.of(context).size.width * 0.12), + // SizedBox(width: MediaQuery.of(context).size.width * 0.16), if (isDesktop) Container( width: MediaQuery.of(context).size.width * 0.2, diff --git a/lib/Screens/itnerary/flights.dart b/lib/Screens/itnerary/flights.dart index 8c858e2..37fce5d 100644 --- a/lib/Screens/itnerary/flights.dart +++ b/lib/Screens/itnerary/flights.dart @@ -971,6 +971,48 @@ class FlightScreenState extends State { ]; } + List filterAndSortCountryList(List items, String filter) { + + final lowerFilter = filter.toLowerCase(); + + int getMatchScore(String item) { + final parts = item.split('\n'); + final cityAndCode = parts[0]; + final airport = parts.length > 1 ? parts[1].toLowerCase() : ''; + + final match = RegExp(r'^(.*)\s+\(([^)]+)\)$').firstMatch(cityAndCode); + final city = match?.group(1)?.toLowerCase() ?? ''; + final code = match?.group(2)?.toLowerCase() ?? ''; + + if (code == lowerFilter) return 0; + if (code.startsWith(lowerFilter)) return 1; + if (code.contains(lowerFilter)) return 2; + if (city == lowerFilter) return 3; + if (city.startsWith(lowerFilter)) return 4; + if (city.contains(lowerFilter)) return 5; + if (airport.contains(lowerFilter)) return 6; + return 999; + } + + return items + .where((item) { + final parts = item.split('\n'); + final cityAndCode = parts[0]; + final airport = parts.length > 1 ? parts[1].toLowerCase() : ''; + + final match = RegExp(r'^(.*)\s+\(([^)]+)\)$').firstMatch(cityAndCode); + final city = match?.group(1)?.toLowerCase() ?? ''; + final code = match?.group(2)?.toLowerCase() ?? ''; + + return code.contains(lowerFilter) || + city.contains(lowerFilter) || + airport.contains(lowerFilter); + }) + .toList() + ..sort((a, b) => getMatchScore(a).compareTo(getMatchScore(b))); + } + + List _buildFirstRow(isDesktop) { return [ Column( @@ -1481,6 +1523,8 @@ class FlightScreenState extends State { // } } + + return [ Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -1528,6 +1572,13 @@ class FlightScreenState extends State { selectedFrom[index] != null ? countryMap[selectedFrom[index]] : null, + asyncItems: (String filter) async { + final allItems = countryMap.values.toSet().toList(); + print("Original items: ${allItems.length}"); + final filtered = filterAndSortCountryList(allItems, filter); + // print("Filtered items: ${filtered.length} -> $filtered"); + return filtered; + }, popupProps: PopupProps.menu( fit: FlexFit.loose, constraints: BoxConstraints(maxHeight: 220), @@ -1616,7 +1667,24 @@ class FlightScreenState extends State { // ), // ), ), - items: countryMap.values.toList(), + // items: countryMap.values.toList(), + // filterFn: (item, filter) { + // final lowerFilter = filter.toLowerCase(); + // + // final parts = item.split('\n'); + // final cityAndCode = parts[0]; + // final airport = parts.length > 1 ? parts[1].toLowerCase() : ''; + // + // // Extract city and code from "City (CODE)" + // final cityMatch = RegExp(r'^(.*)\s+\(([^)]+)\)$').firstMatch(cityAndCode); + // final city = cityMatch?.group(1)?.toLowerCase() ?? ''; + // final code = cityMatch?.group(2)?.toLowerCase() ?? ''; + // + // // Priority: Code > City > Airport + // return code.contains(lowerFilter) || + // city.contains(lowerFilter) || + // airport.contains(lowerFilter); + // }, dropdownDecoratorProps: DropDownDecoratorProps( dropdownSearchDecoration: InputDecoration( border: OutlineInputBorder( @@ -2807,4 +2875,6 @@ class FlightScreenState extends State { ), ]; } + + } diff --git a/lib/Screens/myTemplates/templatesList.dart b/lib/Screens/myTemplates/templatesList.dart index 5839aee..35f899d 100644 --- a/lib/Screens/myTemplates/templatesList.dart +++ b/lib/Screens/myTemplates/templatesList.dart @@ -461,7 +461,8 @@ class TemplatesListState extends State { ], ), if (isDesktop) - SizedBox(width: MediaQuery.of(context).size.width * 0.23), + SizedBox(width: MediaQuery.of(context).size.width * 0.13), + // SizedBox(width: MediaQuery.of(context).size.width * 0.23), if (isDesktop) Container( diff --git a/lib/Screens/organization/mailSettings.dart b/lib/Screens/organization/mailSettings.dart index b75af06..08285a5 100644 --- a/lib/Screens/organization/mailSettings.dart +++ b/lib/Screens/organization/mailSettings.dart @@ -219,76 +219,10 @@ class _MailSettingState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - // Text("mail Settings data"), - Row( - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - "Sender Email", - style: GoogleFonts.poppins( - fontSize: 12, - fontWeight: FontWeight.w600, - color: Color(0xFF575A74), - ), - ), - SizedBox(height: 5), - CustomTextFieldWrapper( - isFocused: false, - isDesktop: widget.isDesktop, - width: - widget.isDesktop - ? MediaQuery.of(context).size.width * 0.34 - : MediaQuery.of(context).size.width * 0.85, - child: SizedBox( - height: 40, - child: TextField( - // focusNode: _destinationFocusNode, - controller: controllers["senderEmail"], - onChanged: (value) { - _clearError("sender_email"); - - // Validate just this one field - if (value.trim().isEmpty) { - errorMessages["sender_email"] = "Required"; - } else if (!RegExp( - r"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$", - ).hasMatch(value)) { - errorMessages["sender_email"] = - "Invalid email format"; - } - }, - style: GoogleFonts.poppins(fontSize: 12), - decoration: InputDecoration( - labelText: "sender email", - labelStyle: GoogleFonts.poppins( - fontSize: 12, - color: Colors.grey, - ), - floatingLabelBehavior: FloatingLabelBehavior.never, - border: InputBorder.none, - contentPadding: EdgeInsets.symmetric(vertical: 16), - ), - ), - ), - ), - if (errorMessages["sender_email"] != null) ...[ - SizedBox(height: 5), // Space before error message - Text( - errorMessages["sender_email"]!, - style: TextStyle(color: Colors.red, fontSize: 12), - ), - ], - ], - ), - ], - ), - SizedBox(height: 10), - widget.isDesktop ? Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.start, children: _buildMailFirstRow(widget.isDesktop), ) : Column( @@ -300,7 +234,8 @@ class _MailSettingState extends State { widget.isDesktop ? Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.start, children: _buildMailSecondRow(widget.isDesktop), ) : Column(children: _buildMailSecondRow(widget.isDesktop)), @@ -322,7 +257,7 @@ class _MailSettingState extends State { ], ), ), - + SizedBox(height: 10), Row( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.end, @@ -334,9 +269,10 @@ class _MailSettingState extends State { ); } - List _buildMailFirstRow(bool isDesktop) { + List _buildMailSecondRow(bool isDesktop) { return [ Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, // ✅ This works crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( @@ -353,7 +289,7 @@ class _MailSettingState extends State { isDesktop: widget.isDesktop, width: widget.isDesktop - ? MediaQuery.of(context).size.width * 0.34 + ? MediaQuery.of(context).size.width * 0.23 : MediaQuery.of(context).size.width * 0.85, child: SizedBox( height: 40, @@ -386,7 +322,9 @@ class _MailSettingState extends State { ], ], ), + if(isDesktop) SizedBox(width:20), Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, // ✅ This works crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( @@ -403,7 +341,7 @@ class _MailSettingState extends State { isDesktop: widget.isDesktop, width: widget.isDesktop - ? MediaQuery.of(context).size.width * 0.34 + ? MediaQuery.of(context).size.width * 0.23 : MediaQuery.of(context).size.width * 0.85, child: SizedBox( height: 40, @@ -458,9 +396,72 @@ class _MailSettingState extends State { ]; } - List _buildMailSecondRow(bool isDesktop) { + List _buildMailFirstRow(bool isDesktop) { return [ Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, // ✅ This works + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "Sender Email", + style: GoogleFonts.poppins( + fontSize: 12, + fontWeight: FontWeight.w600, + color: Color(0xFF575A74), + ), + ), + SizedBox(height: 5), + CustomTextFieldWrapper( + isFocused: false, + isDesktop: widget.isDesktop, + width: + widget.isDesktop + ? MediaQuery.of(context).size.width * 0.23 + : MediaQuery.of(context).size.width * 0.85, + child: SizedBox( + height: 40, + child: TextField( + // focusNode: _destinationFocusNode, + controller: controllers["senderEmail"], + onChanged: (value) { + _clearError("sender_email"); + + // Validate just this one field + if (value.trim().isEmpty) { + errorMessages["sender_email"] = "Required"; + } else if (!RegExp( + r"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$", + ).hasMatch(value)) { + errorMessages["sender_email"] = + "Invalid email format"; + } + }, + style: GoogleFonts.poppins(fontSize: 12), + decoration: InputDecoration( + labelText: "sender email", + labelStyle: GoogleFonts.poppins( + fontSize: 12, + color: Colors.grey, + ), + floatingLabelBehavior: FloatingLabelBehavior.never, + border: InputBorder.none, + contentPadding: EdgeInsets.symmetric(vertical: 16), + ), + ), + ), + ), + if (errorMessages["sender_email"] != null) ...[ + SizedBox(height: 5), // Space before error message + Text( + errorMessages["sender_email"]!, + style: TextStyle(color: Colors.red, fontSize: 12), + ), + ], + ], + ), + if(isDesktop) SizedBox(width:20), + Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, // ✅ This works crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( @@ -477,7 +478,7 @@ class _MailSettingState extends State { isDesktop: widget.isDesktop, width: widget.isDesktop - ? MediaQuery.of(context).size.width * 0.34 + ? MediaQuery.of(context).size.width * 0.23 : MediaQuery.of(context).size.width * 0.85, child: SizedBox( height: 40, @@ -510,7 +511,9 @@ class _MailSettingState extends State { ], ], ), + if(isDesktop) SizedBox(width:20), Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, // ✅ This works crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( @@ -527,7 +530,7 @@ class _MailSettingState extends State { isDesktop: widget.isDesktop, width: widget.isDesktop - ? MediaQuery.of(context).size.width * 0.34 + ? MediaQuery.of(context).size.width * 0.23 : MediaQuery.of(context).size.width * 0.85, child: SizedBox( height: 40, diff --git a/lib/Screens/organization/orgSetup.dart b/lib/Screens/organization/orgSetup.dart index 36d9396..ec61a51 100644 --- a/lib/Screens/organization/orgSetup.dart +++ b/lib/Screens/organization/orgSetup.dart @@ -173,9 +173,17 @@ class _OrgSetUpState extends State { setState(() { selectedOrg = orgData; + // String? rawLogoPath = selectedOrg?['logo']; + // if (rawLogoPath != null && rawLogoPath.contains('/assets')) { + // const baseUrl = "https://apitest.tripapprovaltool.com"; + // final assetPath = rawLogoPath.split('/assets').last; + // selectedOrg!['logo'] = "$baseUrl/assets$assetPath"; + // } + String? rawLogoPath = selectedOrg?['logo']; if (rawLogoPath != null && rawLogoPath.contains('/assets')) { - const baseUrl = "https://apitest.tripapprovaltool.com"; + const baseUrl = apiUrl; + // const baseUrl = "https://apitest.tripapprovaltool.com"; final assetPath = rawLogoPath.split('/assets').last; selectedOrg!['logo'] = "$baseUrl/assets$assetPath"; } @@ -716,6 +724,34 @@ class _OrgSetUpState extends State { ), ), SizedBox(height: 10), + // Container( + // decoration: BoxDecoration( + // border: Border.all(color: Color(0xFFF4F4FB)), + // borderRadius: BorderRadius.circular(1), + // // color: bodyColor, + // // color: Color(0xFFF5F5F5), + // color: Colors.white, + // ), + // padding: EdgeInsets.only( + // left: 5, + // right: 5, + // top: 15, + // bottom: 5, + // ), + // child: + // isDesktop + // ? Row( + // mainAxisAlignment: MainAxisAlignment.spaceEvenly, + // // mainAxisSize: MainAxisSize.min, + // children: _buildOptions(), + // ) + // : Expanded( + // child: SingleChildScrollView( + // scrollDirection: Axis.horizontal, + // child: Row(children: _buildOptions()), + // ), + // ), + // ), Container( decoration: BoxDecoration( border: Border.all(color: Color(0xFFF4F4FB)), @@ -724,25 +760,30 @@ class _OrgSetUpState extends State { // color: Color(0xFFF5F5F5), color: Colors.white, ), - padding: EdgeInsets.only( - left: 5, - right: 5, - top: 15, - bottom: 5, - ), - child: - isDesktop - ? Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - // mainAxisSize: MainAxisSize.min, + padding: EdgeInsets.only(left: 5, right: 5, top: 15, bottom: 5), + + child: SingleChildScrollView( + scrollDirection: Axis.vertical, + child: isDesktop + ? Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: _buildOptions(), + ) + : SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: ConstrainedBox( // ✅ Prevent overflow by setting min width + constraints: BoxConstraints( + minWidth: MediaQuery.of(context).size.width, + ), + child: IntrinsicWidth( // ✅ Let Row size itself correctly + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, children: _buildOptions(), - ) - : Expanded( - child: SingleChildScrollView( - scrollDirection: Axis.horizontal, - child: Row(children: _buildOptions()), - ), ), + ), + ), + ), + ), ), SizedBox(height: 15), @@ -803,7 +844,7 @@ class _OrgSetUpState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( - "Mail Settings", + "Mail Server Settings", style: GoogleFonts.poppins( fontSize: 14, fontWeight: FontWeight.w600, @@ -830,16 +871,16 @@ class _OrgSetUpState extends State { SizedBox(height: 10), Container( // width: double.infinity, - decoration: BoxDecoration( - border: Border.all( - color: Color(0xFFF5F5F5), - // color: bodyColor ?? Colors.grey, - width: 1.5, - ), - // color: bodyColor, - color: Colors.white70, - // color: Color(0xFFF5F5F5), - ), + // decoration: BoxDecoration( + // border: Border.all( + // color: Color(0xFFF5F5F5), + // // color: bodyColor ?? Colors.grey, + // width: 1.5, + // ), + // // color: bodyColor, + // color: Colors.white70, + // // color: Color(0xFFF5F5F5), + // ), child: Row( mainAxisAlignment: isDesktop @@ -968,19 +1009,36 @@ class _OrgSetUpState extends State { height: 15, width: 15, decoration: BoxDecoration( - shape: BoxShape.circle, + shape: BoxShape.rectangle, border: Border.all( - color: isSelected ? Colors.green : Colors.grey, - width: 1, + color: isSelected ? Colors.green : Colors.grey.shade400, + width: isSelected ? 2 : 1, ), ), child: Icon( - Icons.check_circle, + Icons.check, size: 10, - color: isSelected ? Colors.green : Colors.grey, + color: isSelected ? Colors.green : Colors.white10, // color: Colors.grey, ), ), + // Container( + // height: 15, + // width: 15, + // decoration: BoxDecoration( + // shape: BoxShape.circle, + // border: Border.all( + // color: isSelected ? Colors.green : Colors.grey, + // width: 1, + // ), + // ), + // child: Icon( + // Icons.check_circle, + // size: 10, + // color: isSelected ? Colors.green : Colors.grey, + // // color: Colors.grey, + // ), + // ), ], ), ); diff --git a/lib/Screens/organization/themeColor.dart b/lib/Screens/organization/themeColor.dart index 2ad9f5f..e2f4052 100644 --- a/lib/Screens/organization/themeColor.dart +++ b/lib/Screens/organization/themeColor.dart @@ -28,9 +28,20 @@ class _ColorThemePickerWidgetState extends State { Color(0xFF448AFF), // BlueAccent Color(0xFFF44336), // Red Color(0xFF12B24B), // Green + Color(0xFF2ECC71), // Emerald Green Color(0xFFFF9800), // Orange + Color(0xFFE67E22), // Orange 2 + Color(0xFFBF4C0D), // Orange dark orange 3 + Color(0xFFAA9941), // Husk + Color(0xFFD9067A), // rose + Color(0xFFc94b92), // rose light Color(0xFF9C27B0), // Purple - ]; + Color(0xFF9B59B6), // Purple 2 + Color(0xFF027E87), // Blue Shade + Color(0xFF810D26), // Merun Shade + Color(0xFFd1b795), + Color(0xFF7F8C8D) // Slate Gray Neutral and soft + ]; // Body colors final List bodyThemeColors = [ @@ -57,17 +68,16 @@ class _ColorThemePickerWidgetState extends State { children: [ // Layout Color Picker GestureDetector( - onTap: - () => _showColorPickerDialog( - title: "Choose Layout Color", - colors: layoutThemeColors, - onColorSelected: (color) { - setState(() { - selectedLayoutColor = color; - }); - widget.onLayoutColorSelected(color); - }, - ), + onTap: () => _showColorPickerDialog( + title: "Choose Layout Color", + colors: layoutThemeColors, + onColorSelected: (color) { + setState(() { + selectedLayoutColor = color; + }); + widget.onLayoutColorSelected(color); + }, + ), child: _buildColorBox( selectedLayoutColor ?? Colors.grey.shade300, Icons.palette, @@ -93,6 +103,55 @@ class _ColorThemePickerWidgetState extends State { ); } + // Widget _buildColorBox(Color color, IconData icon) { + // return Container( + // width: 40, + // height: 40, + // decoration: BoxDecoration( + // color: color, + // border: Border.all(color: Colors.grey), + // borderRadius: BorderRadius.circular(5), + // ), + // child: Icon(icon, color: Colors.white, size: 20), + // ); + // } + + // void _showColorPickerDialog({ + // required String title, + // required List colors, + // required Function(Color) onColorSelected, + // }) { + // showDialog( + // context: context, + // builder: + // (context) => AlertDialog( + // title: Text(title), + // content: Wrap( + // spacing: 10, + // runSpacing: 10, + // children: + // colors.map((color) { + // return GestureDetector( + // onTap: () { + // onColorSelected(color); + // Navigator.of(context).pop(); + // }, + // child: Container( + // width: 30, + // height: 30, + // decoration: BoxDecoration( + // color: color, + // shape: BoxShape.circle, + // border: Border.all(color: Colors.black26), + // ), + // ), + // ); + // }).toList(), + // ), + // ), + // ); + // } + Widget _buildColorBox(Color color, IconData icon) { return Container( width: 40, @@ -111,34 +170,55 @@ class _ColorThemePickerWidgetState extends State { required List colors, required Function(Color) onColorSelected, }) { + // Dynamically split + List firstRow = []; + List secondRow = []; + + if (colors.length > 5) { + int mid = (colors.length / 2).ceil(); + firstRow = colors.sublist(0, mid); + secondRow = colors.sublist(mid); + } else { + firstRow = colors; + } + showDialog( context: context, - builder: - (context) => AlertDialog( - title: Text(title), - content: Wrap( - spacing: 10, - runSpacing: 10, - children: - colors.map((color) { - return GestureDetector( - onTap: () { - onColorSelected(color); - Navigator.of(context).pop(); - }, - child: Container( - width: 30, - height: 30, - decoration: BoxDecoration( - color: color, - shape: BoxShape.circle, - border: Border.all(color: Colors.black26), - ), - ), - ); - }).toList(), + builder: (context) => AlertDialog( + title: Text(title), + content: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: firstRow.map((color) => _buildColorCircle(color, onColorSelected)).toList(), ), - ), + if (secondRow.isNotEmpty) SizedBox(height: 10), + if (secondRow.isNotEmpty) + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: secondRow.map((color) => _buildColorCircle(color, onColorSelected)).toList(), + ), + ], + ), + ), ); } + + Widget _buildColorCircle(Color color, Function(Color) onSelect) { + return GestureDetector( + onTap: () => onSelect(color), + child: Container( + width: 30, + height: 30, + margin: EdgeInsets.symmetric(horizontal: 4), + decoration: BoxDecoration( + color: color, + shape: BoxShape.circle, + border: Border.all(color: Colors.black26), + ), + ), + ); + } + } diff --git a/lib/Screens/perdiem_amount/forexDetails.dart b/lib/Screens/perdiem_amount/forexDetails.dart index f53ed2b..d3458de 100644 --- a/lib/Screens/perdiem_amount/forexDetails.dart +++ b/lib/Screens/perdiem_amount/forexDetails.dart @@ -470,6 +470,16 @@ class ForexDataState extends State { ), ), items: countryMap.values.toList(), + filterFn: (item, filter) { + final lowerFilter = filter.toLowerCase(); + + final match = RegExp(r'^(.*)\s\((.*)\)$').firstMatch(item); + final countryName = match?.group(1)?.toLowerCase() ?? ''; + final countryCode = match?.group(2)?.toLowerCase() ?? ''; + + // Prioritize country code match, fallback to country name + return countryCode.contains(lowerFilter) || countryName.contains(lowerFilter); + }, dropdownDecoratorProps: DropDownDecoratorProps( dropdownSearchDecoration: InputDecoration( // border: InputBorder.none, diff --git a/lib/Screens/perdiem_amount/forex_list.dart b/lib/Screens/perdiem_amount/forex_list.dart index ca8c559..2845a8e 100644 --- a/lib/Screens/perdiem_amount/forex_list.dart +++ b/lib/Screens/perdiem_amount/forex_list.dart @@ -477,7 +477,8 @@ class ForexDataListState extends State { ], ), if (isDesktop) - SizedBox(width: MediaQuery.of(context).size.width * 0.16), + SizedBox(width: MediaQuery.of(context).size.width * 0.1), + // SizedBox(width: MediaQuery.of(context).size.width * 0.16), if (isDesktop) Container( diff --git a/lib/Screens/policy/policy_list.dart b/lib/Screens/policy/policy_list.dart index 667ba53..07c7f29 100644 --- a/lib/Screens/policy/policy_list.dart +++ b/lib/Screens/policy/policy_list.dart @@ -363,7 +363,8 @@ class _PolicyListState extends State { ], ), if (isDesktop) - SizedBox(width: MediaQuery.of(context).size.width * 0.28), + SizedBox(width: MediaQuery.of(context).size.width * 0.145), + // SizedBox(width: MediaQuery.of(context).size.width * 0.28), if (isDesktop) Container( diff --git a/lib/Screens/traveller/travellerList.dart b/lib/Screens/traveller/travellerList.dart index 8135134..a32eabc 100644 --- a/lib/Screens/traveller/travellerList.dart +++ b/lib/Screens/traveller/travellerList.dart @@ -316,7 +316,8 @@ class TravellerListState extends State { ], ), if (isDesktop) - SizedBox(width: MediaQuery.of(context).size.width * 0.16), + SizedBox(width: MediaQuery.of(context).size.width * 0.10), + // SizedBox(width: MediaQuery.of(context).size.width * 0.16), if (isDesktop) Container( diff --git a/lib/Screens/userManagement/create_traveller_agent/createTravelAgent.dart b/lib/Screens/userManagement/create_traveller_agent/createTravelAgent.dart index 42896e0..738a320 100644 --- a/lib/Screens/userManagement/create_traveller_agent/createTravelAgent.dart +++ b/lib/Screens/userManagement/create_traveller_agent/createTravelAgent.dart @@ -1171,7 +1171,7 @@ class _CreateTravelAgentFormDetialsState Widget buildData(bool isDesktop, context) { return Container( - margin: isDesktop ? const EdgeInsets.only(top: 10.0, bottom: 10.0) : null, + margin: isDesktop ? const EdgeInsets.only(top: 10.0, bottom: 1.0) : null, padding: const EdgeInsets.only(left: 10, right: 10, top: 5), decoration: BoxDecoration( color: isDesktop ? Colors.white : Color(0xFFFCFCFC), @@ -1288,12 +1288,12 @@ class _CreateTravelAgentFormDetialsState ], ), SizedBox(height: 18), - isDesktop - ? buildTabsForUser() - : SingleChildScrollView( - scrollDirection: Axis.horizontal, - child: buildTabsForUser(), - ), + // isDesktop + // ? buildTabsForUser() + // : SingleChildScrollView( + // scrollDirection: Axis.horizontal, + // child: buildTabsForUser(), + // ), Container( // color: Colors.yellow.shade50, height: MediaQuery.of(context).size.height * 0.64, diff --git a/lib/Screens/userManagement/create_traveller_agent/listTravelAgent.dart b/lib/Screens/userManagement/create_traveller_agent/listTravelAgent.dart index aa01cca..82869db 100644 --- a/lib/Screens/userManagement/create_traveller_agent/listTravelAgent.dart +++ b/lib/Screens/userManagement/create_traveller_agent/listTravelAgent.dart @@ -475,9 +475,9 @@ class _TravelAgentListScreenState extends State { ], ), if (isDesktop) - SizedBox(width: MediaQuery.of(context).size.width * 0.23), - - // SizedBox(width: MediaQuery.of(context).size.width * 0.15), + SizedBox(width: MediaQuery.of(context).size.width * 0.03), + // SizedBox(width: MediaQuery.of(context).size.width * 0.23), + // SizedBox(width: MediaQuery.of(context).size.width * 0.15), if (isDesktop) Container( width: MediaQuery.of(context).size.width * 0.2, diff --git a/lib/Screens/userManagement/create_traveller_agent/personalDetailsTravelAgent.dart b/lib/Screens/userManagement/create_traveller_agent/personalDetailsTravelAgent.dart index 7b2fdc0..ce81e6d 100644 --- a/lib/Screens/userManagement/create_traveller_agent/personalDetailsTravelAgent.dart +++ b/lib/Screens/userManagement/create_traveller_agent/personalDetailsTravelAgent.dart @@ -420,11 +420,15 @@ class PersonalDetailsState extends State { padding: EdgeInsets.only(left: 5, right: 5, top: 15, bottom: 5), child: isDesktop - ? Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - // mainAxisSize: MainAxisSize.min, - children: _buildOptions(), - ) + ? SingleChildScrollView( + scrollDirection: Axis.vertical, + child: SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Row( + children: _buildOptions(), + ), + ), + ) : Expanded( child: SingleChildScrollView( scrollDirection: Axis.horizontal, @@ -1263,11 +1267,12 @@ class PersonalDetailsState extends State { final countryCode = match?.group(2) ?? ''; return Padding( padding: const EdgeInsets.symmetric( - horizontal: 8.0, + horizontal: 10.0, vertical: 6.0, ), child: Padding( - padding: const EdgeInsets.all(8.0), + // padding: const EdgeInsets.all(3.0), + padding: EdgeInsets.symmetric(horizontal: 2,vertical: 3), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -1287,7 +1292,7 @@ class PersonalDetailsState extends State { ), ); }, - constraints: BoxConstraints(maxHeight: 200), + constraints: BoxConstraints(maxHeight: 180), searchFieldProps: TextFieldProps( decoration: InputDecoration( hintText: "Search Country...",