minor issues fixes 4
This commit is contained in:
parent
eee3182898
commit
91f1e86afa
@ -308,7 +308,8 @@ class CostCenterListState extends State<CostCenterList> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
if (isDesktop)
|
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)
|
if (isDesktop)
|
||||||
Container(
|
Container(
|
||||||
|
|||||||
@ -307,7 +307,8 @@ class DepartmentListState extends State<DepartmentList> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
if (isDesktop)
|
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)
|
if (isDesktop)
|
||||||
Container(
|
Container(
|
||||||
|
|||||||
@ -327,7 +327,8 @@ class _GroupListState extends State<GroupList> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
if (isDesktop)
|
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)
|
if (isDesktop)
|
||||||
Container(
|
Container(
|
||||||
|
|||||||
@ -358,8 +358,8 @@ class HotelsDataListState extends State<HotelsDataList> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
if (isDesktop)
|
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)
|
if (isDesktop)
|
||||||
Container(
|
Container(
|
||||||
width: MediaQuery.of(context).size.width * 0.2,
|
width: MediaQuery.of(context).size.width * 0.2,
|
||||||
|
|||||||
@ -971,6 +971,48 @@ class FlightScreenState extends State<FlightScreen> {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<String> filterAndSortCountryList(List<String> 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<Widget> _buildFirstRow(isDesktop) {
|
List<Widget> _buildFirstRow(isDesktop) {
|
||||||
return [
|
return [
|
||||||
Column(
|
Column(
|
||||||
@ -1481,6 +1523,8 @@ class FlightScreenState extends State<FlightScreen> {
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return [
|
return [
|
||||||
Column(
|
Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
@ -1528,6 +1572,13 @@ class FlightScreenState extends State<FlightScreen> {
|
|||||||
selectedFrom[index] != null
|
selectedFrom[index] != null
|
||||||
? countryMap[selectedFrom[index]]
|
? countryMap[selectedFrom[index]]
|
||||||
: null,
|
: 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(
|
popupProps: PopupProps.menu(
|
||||||
fit: FlexFit.loose,
|
fit: FlexFit.loose,
|
||||||
constraints: BoxConstraints(maxHeight: 220),
|
constraints: BoxConstraints(maxHeight: 220),
|
||||||
@ -1616,7 +1667,24 @@ class FlightScreenState extends State<FlightScreen> {
|
|||||||
// ),
|
// ),
|
||||||
// ),
|
// ),
|
||||||
),
|
),
|
||||||
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(
|
dropdownDecoratorProps: DropDownDecoratorProps(
|
||||||
dropdownSearchDecoration: InputDecoration(
|
dropdownSearchDecoration: InputDecoration(
|
||||||
border: OutlineInputBorder(
|
border: OutlineInputBorder(
|
||||||
@ -2807,4 +2875,6 @@ class FlightScreenState extends State<FlightScreen> {
|
|||||||
),
|
),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -461,7 +461,8 @@ class TemplatesListState extends State<TemplatesList> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
if (isDesktop)
|
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)
|
if (isDesktop)
|
||||||
Container(
|
Container(
|
||||||
|
|||||||
@ -219,76 +219,10 @@ class _MailSettingState extends State<MailSetting> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
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
|
widget.isDesktop
|
||||||
? Row(
|
? Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: _buildMailFirstRow(widget.isDesktop),
|
children: _buildMailFirstRow(widget.isDesktop),
|
||||||
)
|
)
|
||||||
: Column(
|
: Column(
|
||||||
@ -300,7 +234,8 @@ class _MailSettingState extends State<MailSetting> {
|
|||||||
|
|
||||||
widget.isDesktop
|
widget.isDesktop
|
||||||
? Row(
|
? Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: _buildMailSecondRow(widget.isDesktop),
|
children: _buildMailSecondRow(widget.isDesktop),
|
||||||
)
|
)
|
||||||
: Column(children: _buildMailSecondRow(widget.isDesktop)),
|
: Column(children: _buildMailSecondRow(widget.isDesktop)),
|
||||||
@ -322,7 +257,7 @@ class _MailSettingState extends State<MailSetting> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
SizedBox(height: 10),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
@ -334,9 +269,10 @@ class _MailSettingState extends State<MailSetting> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Widget> _buildMailFirstRow(bool isDesktop) {
|
List<Widget> _buildMailSecondRow(bool isDesktop) {
|
||||||
return [
|
return [
|
||||||
Column(
|
Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, // ✅ This works
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
@ -353,7 +289,7 @@ class _MailSettingState extends State<MailSetting> {
|
|||||||
isDesktop: widget.isDesktop,
|
isDesktop: widget.isDesktop,
|
||||||
width:
|
width:
|
||||||
widget.isDesktop
|
widget.isDesktop
|
||||||
? MediaQuery.of(context).size.width * 0.34
|
? MediaQuery.of(context).size.width * 0.23
|
||||||
: MediaQuery.of(context).size.width * 0.85,
|
: MediaQuery.of(context).size.width * 0.85,
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: 40,
|
height: 40,
|
||||||
@ -386,7 +322,9 @@ class _MailSettingState extends State<MailSetting> {
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
if(isDesktop) SizedBox(width:20),
|
||||||
Column(
|
Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, // ✅ This works
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
@ -403,7 +341,7 @@ class _MailSettingState extends State<MailSetting> {
|
|||||||
isDesktop: widget.isDesktop,
|
isDesktop: widget.isDesktop,
|
||||||
width:
|
width:
|
||||||
widget.isDesktop
|
widget.isDesktop
|
||||||
? MediaQuery.of(context).size.width * 0.34
|
? MediaQuery.of(context).size.width * 0.23
|
||||||
: MediaQuery.of(context).size.width * 0.85,
|
: MediaQuery.of(context).size.width * 0.85,
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: 40,
|
height: 40,
|
||||||
@ -458,9 +396,72 @@ class _MailSettingState extends State<MailSetting> {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Widget> _buildMailSecondRow(bool isDesktop) {
|
List<Widget> _buildMailFirstRow(bool isDesktop) {
|
||||||
return [
|
return [
|
||||||
Column(
|
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,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
@ -477,7 +478,7 @@ class _MailSettingState extends State<MailSetting> {
|
|||||||
isDesktop: widget.isDesktop,
|
isDesktop: widget.isDesktop,
|
||||||
width:
|
width:
|
||||||
widget.isDesktop
|
widget.isDesktop
|
||||||
? MediaQuery.of(context).size.width * 0.34
|
? MediaQuery.of(context).size.width * 0.23
|
||||||
: MediaQuery.of(context).size.width * 0.85,
|
: MediaQuery.of(context).size.width * 0.85,
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: 40,
|
height: 40,
|
||||||
@ -510,7 +511,9 @@ class _MailSettingState extends State<MailSetting> {
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
if(isDesktop) SizedBox(width:20),
|
||||||
Column(
|
Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, // ✅ This works
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
@ -527,7 +530,7 @@ class _MailSettingState extends State<MailSetting> {
|
|||||||
isDesktop: widget.isDesktop,
|
isDesktop: widget.isDesktop,
|
||||||
width:
|
width:
|
||||||
widget.isDesktop
|
widget.isDesktop
|
||||||
? MediaQuery.of(context).size.width * 0.34
|
? MediaQuery.of(context).size.width * 0.23
|
||||||
: MediaQuery.of(context).size.width * 0.85,
|
: MediaQuery.of(context).size.width * 0.85,
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: 40,
|
height: 40,
|
||||||
|
|||||||
@ -173,9 +173,17 @@ class _OrgSetUpState extends State<OrgSetUp> {
|
|||||||
setState(() {
|
setState(() {
|
||||||
selectedOrg = orgData;
|
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'];
|
String? rawLogoPath = selectedOrg?['logo'];
|
||||||
if (rawLogoPath != null && rawLogoPath.contains('/assets')) {
|
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;
|
final assetPath = rawLogoPath.split('/assets').last;
|
||||||
selectedOrg!['logo'] = "$baseUrl/assets$assetPath";
|
selectedOrg!['logo'] = "$baseUrl/assets$assetPath";
|
||||||
}
|
}
|
||||||
@ -716,6 +724,34 @@ class _OrgSetUpState extends State<OrgSetUp> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 10),
|
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(
|
Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
border: Border.all(color: Color(0xFFF4F4FB)),
|
border: Border.all(color: Color(0xFFF4F4FB)),
|
||||||
@ -724,25 +760,30 @@ class _OrgSetUpState extends State<OrgSetUp> {
|
|||||||
// color: Color(0xFFF5F5F5),
|
// color: Color(0xFFF5F5F5),
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
),
|
),
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(left: 5, right: 5, top: 15, bottom: 5),
|
||||||
left: 5,
|
|
||||||
right: 5,
|
child: SingleChildScrollView(
|
||||||
top: 15,
|
scrollDirection: Axis.vertical,
|
||||||
bottom: 5,
|
child: isDesktop
|
||||||
),
|
? Row(
|
||||||
child:
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
isDesktop
|
children: _buildOptions(),
|
||||||
? Row(
|
)
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
: SingleChildScrollView(
|
||||||
// mainAxisSize: MainAxisSize.min,
|
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(),
|
children: _buildOptions(),
|
||||||
)
|
|
||||||
: Expanded(
|
|
||||||
child: SingleChildScrollView(
|
|
||||||
scrollDirection: Axis.horizontal,
|
|
||||||
child: Row(children: _buildOptions()),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 15),
|
SizedBox(height: 15),
|
||||||
|
|
||||||
@ -803,7 +844,7 @@ class _OrgSetUpState extends State<OrgSetUp> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"Mail Settings",
|
"Mail Server Settings",
|
||||||
style: GoogleFonts.poppins(
|
style: GoogleFonts.poppins(
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
@ -830,16 +871,16 @@ class _OrgSetUpState extends State<OrgSetUp> {
|
|||||||
SizedBox(height: 10),
|
SizedBox(height: 10),
|
||||||
Container(
|
Container(
|
||||||
// width: double.infinity,
|
// width: double.infinity,
|
||||||
decoration: BoxDecoration(
|
// decoration: BoxDecoration(
|
||||||
border: Border.all(
|
// border: Border.all(
|
||||||
color: Color(0xFFF5F5F5),
|
// color: Color(0xFFF5F5F5),
|
||||||
// color: bodyColor ?? Colors.grey,
|
// // color: bodyColor ?? Colors.grey,
|
||||||
width: 1.5,
|
// width: 1.5,
|
||||||
),
|
// ),
|
||||||
// color: bodyColor,
|
// // color: bodyColor,
|
||||||
color: Colors.white70,
|
// color: Colors.white70,
|
||||||
// color: Color(0xFFF5F5F5),
|
// // color: Color(0xFFF5F5F5),
|
||||||
),
|
// ),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment:
|
||||||
isDesktop
|
isDesktop
|
||||||
@ -968,19 +1009,36 @@ class _OrgSetUpState extends State<OrgSetUp> {
|
|||||||
height: 15,
|
height: 15,
|
||||||
width: 15,
|
width: 15,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
shape: BoxShape.circle,
|
shape: BoxShape.rectangle,
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: isSelected ? Colors.green : Colors.grey,
|
color: isSelected ? Colors.green : Colors.grey.shade400,
|
||||||
width: 1,
|
width: isSelected ? 2 : 1,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Icons.check_circle,
|
Icons.check,
|
||||||
size: 10,
|
size: 10,
|
||||||
color: isSelected ? Colors.green : Colors.grey,
|
color: isSelected ? Colors.green : Colors.white10,
|
||||||
// color: Colors.grey,
|
// 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,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@ -28,9 +28,20 @@ class _ColorThemePickerWidgetState extends State<ColorThemePickerWidget> {
|
|||||||
Color(0xFF448AFF), // BlueAccent
|
Color(0xFF448AFF), // BlueAccent
|
||||||
Color(0xFFF44336), // Red
|
Color(0xFFF44336), // Red
|
||||||
Color(0xFF12B24B), // Green
|
Color(0xFF12B24B), // Green
|
||||||
|
Color(0xFF2ECC71), // Emerald Green
|
||||||
Color(0xFFFF9800), // Orange
|
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(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
|
// Body colors
|
||||||
final List<Color> bodyThemeColors = [
|
final List<Color> bodyThemeColors = [
|
||||||
@ -57,17 +68,16 @@ class _ColorThemePickerWidgetState extends State<ColorThemePickerWidget> {
|
|||||||
children: [
|
children: [
|
||||||
// Layout Color Picker
|
// Layout Color Picker
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap:
|
onTap: () => _showColorPickerDialog(
|
||||||
() => _showColorPickerDialog(
|
title: "Choose Layout Color",
|
||||||
title: "Choose Layout Color",
|
colors: layoutThemeColors,
|
||||||
colors: layoutThemeColors,
|
onColorSelected: (color) {
|
||||||
onColorSelected: (color) {
|
setState(() {
|
||||||
setState(() {
|
selectedLayoutColor = color;
|
||||||
selectedLayoutColor = color;
|
});
|
||||||
});
|
widget.onLayoutColorSelected(color);
|
||||||
widget.onLayoutColorSelected(color);
|
},
|
||||||
},
|
),
|
||||||
),
|
|
||||||
child: _buildColorBox(
|
child: _buildColorBox(
|
||||||
selectedLayoutColor ?? Colors.grey.shade300,
|
selectedLayoutColor ?? Colors.grey.shade300,
|
||||||
Icons.palette,
|
Icons.palette,
|
||||||
@ -93,6 +103,55 @@ class _ColorThemePickerWidgetState extends State<ColorThemePickerWidget> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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<Color> 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) {
|
Widget _buildColorBox(Color color, IconData icon) {
|
||||||
return Container(
|
return Container(
|
||||||
width: 40,
|
width: 40,
|
||||||
@ -111,34 +170,55 @@ class _ColorThemePickerWidgetState extends State<ColorThemePickerWidget> {
|
|||||||
required List<Color> colors,
|
required List<Color> colors,
|
||||||
required Function(Color) onColorSelected,
|
required Function(Color) onColorSelected,
|
||||||
}) {
|
}) {
|
||||||
|
// Dynamically split
|
||||||
|
List<Color> firstRow = [];
|
||||||
|
List<Color> secondRow = [];
|
||||||
|
|
||||||
|
if (colors.length > 5) {
|
||||||
|
int mid = (colors.length / 2).ceil();
|
||||||
|
firstRow = colors.sublist(0, mid);
|
||||||
|
secondRow = colors.sublist(mid);
|
||||||
|
} else {
|
||||||
|
firstRow = colors;
|
||||||
|
}
|
||||||
|
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder:
|
builder: (context) => AlertDialog(
|
||||||
(context) => AlertDialog(
|
title: Text(title),
|
||||||
title: Text(title),
|
content: Column(
|
||||||
content: Wrap(
|
mainAxisSize: MainAxisSize.min,
|
||||||
spacing: 10,
|
children: [
|
||||||
runSpacing: 10,
|
Row(
|
||||||
children:
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
colors.map((color) {
|
children: firstRow.map((color) => _buildColorCircle(color, onColorSelected)).toList(),
|
||||||
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(),
|
|
||||||
),
|
),
|
||||||
),
|
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),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -470,6 +470,16 @@ class ForexDataState extends State<ForexData> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
items: countryMap.values.toList(),
|
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(
|
dropdownDecoratorProps: DropDownDecoratorProps(
|
||||||
dropdownSearchDecoration: InputDecoration(
|
dropdownSearchDecoration: InputDecoration(
|
||||||
// border: InputBorder.none,
|
// border: InputBorder.none,
|
||||||
|
|||||||
@ -477,7 +477,8 @@ class ForexDataListState extends State<ForexDataList> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
if (isDesktop)
|
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)
|
if (isDesktop)
|
||||||
Container(
|
Container(
|
||||||
|
|||||||
@ -363,7 +363,8 @@ class _PolicyListState extends State<PolicyList> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
if (isDesktop)
|
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)
|
if (isDesktop)
|
||||||
Container(
|
Container(
|
||||||
|
|||||||
@ -316,7 +316,8 @@ class TravellerListState extends State<TravellerList> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
if (isDesktop)
|
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)
|
if (isDesktop)
|
||||||
Container(
|
Container(
|
||||||
|
|||||||
@ -1171,7 +1171,7 @@ class _CreateTravelAgentFormDetialsState
|
|||||||
|
|
||||||
Widget buildData(bool isDesktop, context) {
|
Widget buildData(bool isDesktop, context) {
|
||||||
return Container(
|
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),
|
padding: const EdgeInsets.only(left: 10, right: 10, top: 5),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: isDesktop ? Colors.white : Color(0xFFFCFCFC),
|
color: isDesktop ? Colors.white : Color(0xFFFCFCFC),
|
||||||
@ -1288,12 +1288,12 @@ class _CreateTravelAgentFormDetialsState
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
SizedBox(height: 18),
|
SizedBox(height: 18),
|
||||||
isDesktop
|
// isDesktop
|
||||||
? buildTabsForUser()
|
// ? buildTabsForUser()
|
||||||
: SingleChildScrollView(
|
// : SingleChildScrollView(
|
||||||
scrollDirection: Axis.horizontal,
|
// scrollDirection: Axis.horizontal,
|
||||||
child: buildTabsForUser(),
|
// child: buildTabsForUser(),
|
||||||
),
|
// ),
|
||||||
Container(
|
Container(
|
||||||
// color: Colors.yellow.shade50,
|
// color: Colors.yellow.shade50,
|
||||||
height: MediaQuery.of(context).size.height * 0.64,
|
height: MediaQuery.of(context).size.height * 0.64,
|
||||||
|
|||||||
@ -475,9 +475,9 @@ class _TravelAgentListScreenState extends State<TravelAgentListScreen> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
if (isDesktop)
|
if (isDesktop)
|
||||||
SizedBox(width: MediaQuery.of(context).size.width * 0.23),
|
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),
|
// SizedBox(width: MediaQuery.of(context).size.width * 0.15),
|
||||||
if (isDesktop)
|
if (isDesktop)
|
||||||
Container(
|
Container(
|
||||||
width: MediaQuery.of(context).size.width * 0.2,
|
width: MediaQuery.of(context).size.width * 0.2,
|
||||||
|
|||||||
@ -420,11 +420,15 @@ class PersonalDetailsState extends State<PersonalDetails> {
|
|||||||
padding: EdgeInsets.only(left: 5, right: 5, top: 15, bottom: 5),
|
padding: EdgeInsets.only(left: 5, right: 5, top: 15, bottom: 5),
|
||||||
child:
|
child:
|
||||||
isDesktop
|
isDesktop
|
||||||
? Row(
|
? SingleChildScrollView(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
scrollDirection: Axis.vertical,
|
||||||
// mainAxisSize: MainAxisSize.min,
|
child: SingleChildScrollView(
|
||||||
children: _buildOptions(),
|
scrollDirection: Axis.horizontal,
|
||||||
)
|
child: Row(
|
||||||
|
children: _buildOptions(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
: Expanded(
|
: Expanded(
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
scrollDirection: Axis.horizontal,
|
scrollDirection: Axis.horizontal,
|
||||||
@ -1263,11 +1267,12 @@ class PersonalDetailsState extends State<PersonalDetails> {
|
|||||||
final countryCode = match?.group(2) ?? '';
|
final countryCode = match?.group(2) ?? '';
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
horizontal: 8.0,
|
horizontal: 10.0,
|
||||||
vertical: 6.0,
|
vertical: 6.0,
|
||||||
),
|
),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
// padding: const EdgeInsets.all(3.0),
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 2,vertical: 3),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
@ -1287,7 +1292,7 @@ class PersonalDetailsState extends State<PersonalDetails> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
constraints: BoxConstraints(maxHeight: 200),
|
constraints: BoxConstraints(maxHeight: 180),
|
||||||
searchFieldProps: TextFieldProps(
|
searchFieldProps: TextFieldProps(
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
hintText: "Search Country...",
|
hintText: "Search Country...",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user