FIX_TRACKER
This commit is contained in:
parent
b24215272f
commit
fa00f90f8a
@ -445,16 +445,14 @@ class _AccomodationListWidgetState extends State<AccomodationListWidget> {
|
|||||||
item["destination_city"],
|
item["destination_city"],
|
||||||
),
|
),
|
||||||
SizedBox(height: 5),
|
SizedBox(height: 5),
|
||||||
_buildDateTimeRow(
|
_buildRow(
|
||||||
"Check (in)",
|
"Check (in)",
|
||||||
formatDate(item["checkin_date"]!),
|
"${formatDate(item["checkin_date"]!)} ${formatTime(item["checkin_time"]!)}",
|
||||||
formatTime(item["checkin_time"]!),
|
|
||||||
),
|
),
|
||||||
SizedBox(height: 5),
|
SizedBox(height: 5),
|
||||||
_buildDateTimeRow(
|
_buildRow(
|
||||||
"Check (out)",
|
"Check (out)",
|
||||||
formatDate(item["checkout_date"]!),
|
"${formatDate(item["checkout_date"]!)} ${formatTime(item["checkout_time"]!)}",
|
||||||
formatTime(item["checkout_time"]!),
|
|
||||||
),
|
),
|
||||||
SizedBox(height: 5),
|
SizedBox(height: 5),
|
||||||
_buildRow("Comments:", item["comments"] ?? "N/A"),
|
_buildRow("Comments:", item["comments"] ?? "N/A"),
|
||||||
@ -630,13 +628,11 @@ class _AccomodationListWidgetState extends State<AccomodationListWidget> {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
// color: Colors.yellowAccent.shade100,
|
// color: Colors.yellowAccent.shade100,
|
||||||
width: 100,
|
width: 100,
|
||||||
child: Expanded(
|
child: Text(
|
||||||
child: Text(
|
title,
|
||||||
title,
|
style: GoogleFonts.poppins(
|
||||||
style: GoogleFonts.poppins(
|
fontSize: 12,
|
||||||
fontSize: 12,
|
fontWeight: FontWeight.w600,
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -321,13 +321,16 @@ class _ForexListWidgetState extends State<ForexListWidget> {
|
|||||||
Row(
|
Row(
|
||||||
// mainAxisAlignment: MainAxisAlignment.end,
|
// mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Expanded(
|
||||||
getRequestForCountry(item["country_code"]!.toString()),
|
flex: 1,
|
||||||
style: GoogleFonts.poppins(
|
child: Text(
|
||||||
fontSize: 14,
|
getRequestForCountry(item["country_code"]!.toString()),
|
||||||
fontWeight:
|
style: GoogleFonts.poppins(
|
||||||
isDesktop ? FontWeight.w800 : FontWeight.w600,
|
fontSize: 14,
|
||||||
color: !isDesktop ? Colors.black : Color(0xFF575A74),
|
fontWeight:
|
||||||
|
isDesktop ? FontWeight.w800 : FontWeight.w600,
|
||||||
|
color: !isDesktop ? Colors.black : Color(0xFF575A74),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Spacer(),
|
Spacer(),
|
||||||
@ -357,7 +360,6 @@ class _ForexListWidgetState extends State<ForexListWidget> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(width: 10),
|
|
||||||
item['forex_id'] != null
|
item['forex_id'] != null
|
||||||
? IconButton(
|
? IconButton(
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
|
|||||||
@ -578,8 +578,6 @@ class TemplateForexState extends State<TemplateForex> {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
|
|
||||||
|
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
@ -587,15 +585,13 @@ class TemplateForexState extends State<TemplateForex> {
|
|||||||
isDesktop: isDesktop,
|
isDesktop: isDesktop,
|
||||||
breadcrumbItems: [
|
breadcrumbItems: [
|
||||||
BreadcrumbItem(
|
BreadcrumbItem(
|
||||||
title: 'Org Settings',
|
title: 'Org Settings',
|
||||||
tooltip: 'Go To Organization Settings',
|
tooltip: 'Go To Organization Settings',
|
||||||
onTap: (context) {
|
onTap: (context) {
|
||||||
context.go("/OrganizationSettings");
|
context.go("/OrganizationSettings");
|
||||||
}
|
},
|
||||||
),
|
|
||||||
BreadcrumbItem(
|
|
||||||
title: 'Forex',
|
|
||||||
),
|
),
|
||||||
|
BreadcrumbItem(title: 'Forex'),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -788,7 +784,7 @@ class TemplateForexState extends State<TemplateForex> {
|
|||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
height: MediaQuery.of(context).size.height * 0.5,
|
height: MediaQuery.of(context).size.height * 0.45,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(10),
|
borderRadius: BorderRadius.circular(10),
|
||||||
border: Border.all(color: Color(0xFFD6D5E6), width: 0.5),
|
border: Border.all(color: Color(0xFFD6D5E6), width: 0.5),
|
||||||
@ -862,17 +858,18 @@ class TemplateForexState extends State<TemplateForex> {
|
|||||||
SizedBox(width: 10),
|
SizedBox(width: 10),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
onPressed: isDisable
|
onPressed:
|
||||||
? null
|
isDisable
|
||||||
: () async {
|
? null
|
||||||
setState(() {
|
: () async {
|
||||||
isDisable = true;
|
setState(() {
|
||||||
});
|
isDisable = true;
|
||||||
|
});
|
||||||
|
|
||||||
await handleSubmit();
|
await handleSubmit();
|
||||||
// You can get text from commentController.text
|
// You can get text from commentController.text
|
||||||
// Navigator.of(context).pop(); // Close the modal
|
// Navigator.of(context).pop(); // Close the modal
|
||||||
},
|
},
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
backgroundColor: layoutColor,
|
backgroundColor: layoutColor,
|
||||||
// backgroundColor: widget.layoutColor,
|
// backgroundColor: widget.layoutColor,
|
||||||
|
|||||||
@ -1131,7 +1131,7 @@ class _OrgSetUpState extends State<OrgSetUp> {
|
|||||||
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 12),
|
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 12),
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
context.go('/listPlan');
|
context.go('/OrganizationSettings');
|
||||||
},
|
},
|
||||||
child: Text("Cancel", style: GoogleFonts.poppins(fontSize: 12)),
|
child: Text("Cancel", style: GoogleFonts.poppins(fontSize: 12)),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -18,10 +18,10 @@ import '../../../services/apiService.dart';
|
|||||||
import '../../../utils/pagination.dart';
|
import '../../../utils/pagination.dart';
|
||||||
import '../../../widgets/custom_breadcrumb_navigation.dart';
|
import '../../../widgets/custom_breadcrumb_navigation.dart';
|
||||||
import '../../../widgets/popup_travelAgentList_action.dart';
|
import '../../../widgets/popup_travelAgentList_action.dart';
|
||||||
|
|
||||||
/// import '../../../widgets/custom_popup.dart';
|
/// import '../../../widgets/custom_popup.dart';
|
||||||
/// import '../../../../widgets/popup_TravelAgentList_action.dart';
|
/// import '../../../../widgets/popup_TravelAgentList_action.dart';
|
||||||
|
|
||||||
|
|
||||||
class TravelAgentListScreen extends StatefulWidget {
|
class TravelAgentListScreen extends StatefulWidget {
|
||||||
@override
|
@override
|
||||||
_TravelAgentListScreenState createState() => _TravelAgentListScreenState();
|
_TravelAgentListScreenState createState() => _TravelAgentListScreenState();
|
||||||
@ -144,7 +144,8 @@ class _TravelAgentListScreenState extends State<TravelAgentListScreen> {
|
|||||||
Future<List<dynamic>> fetchUsers() async {
|
Future<List<dynamic>> fetchUsers() async {
|
||||||
// return [];
|
// return [];
|
||||||
orgId = await getOrgId();
|
orgId = await getOrgId();
|
||||||
final String apiUrlData = '$apiUrl/api/agentList?org_id=$orgId&for=table_view';
|
final String apiUrlData =
|
||||||
|
'$apiUrl/api/agentList?org_id=$orgId&for=table_view';
|
||||||
final String? token = await getToken();
|
final String? token = await getToken();
|
||||||
|
|
||||||
print("Fetch Users");
|
print("Fetch Users");
|
||||||
@ -459,15 +460,13 @@ class _TravelAgentListScreenState extends State<TravelAgentListScreen> {
|
|||||||
isDesktop: isDesktop,
|
isDesktop: isDesktop,
|
||||||
breadcrumbItems: [
|
breadcrumbItems: [
|
||||||
BreadcrumbItem(
|
BreadcrumbItem(
|
||||||
title: 'Org Settings',
|
title: 'Org Settings',
|
||||||
tooltip: 'Go To Organization Settings',
|
tooltip: 'Go To Organization Settings',
|
||||||
onTap: (context) {
|
onTap: (context) {
|
||||||
context.go("/OrganizationSettings");
|
context.go("/OrganizationSettings");
|
||||||
}
|
},
|
||||||
),
|
|
||||||
BreadcrumbItem(
|
|
||||||
title: 'Travel Agent',
|
|
||||||
),
|
),
|
||||||
|
BreadcrumbItem(title: 'Travel Agent'),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -483,8 +482,8 @@ class _TravelAgentListScreenState extends State<TravelAgentListScreen> {
|
|||||||
),
|
),
|
||||||
if (isDesktop)
|
if (isDesktop)
|
||||||
SizedBox(width: MediaQuery.of(context).size.width * 0.03),
|
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.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,
|
||||||
@ -844,11 +843,12 @@ class _TravelAgentListScreenState extends State<TravelAgentListScreen> {
|
|||||||
DataCell(
|
DataCell(
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment:
|
||||||
MainAxisAlignment.start,
|
MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
child: Tooltip(
|
child: Tooltip(
|
||||||
message: 'Edit Travel Agent Details',
|
message:
|
||||||
|
'Edit Travel Agent Details',
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
'assets/images/IconsImg/edit.png',
|
'assets/images/IconsImg/edit.png',
|
||||||
width: 20,
|
width: 20,
|
||||||
@ -858,12 +858,18 @@ class _TravelAgentListScreenState extends State<TravelAgentListScreen> {
|
|||||||
onTap: () async {
|
onTap: () async {
|
||||||
// Navigator.pop(context); // Close the menu
|
// Navigator.pop(context); // Close the menu
|
||||||
// final userId = user['user_id'];
|
// final userId = user['user_id'];
|
||||||
final userId = int.parse(user['user_id'].toString());
|
final userId = int.parse(
|
||||||
final usersData = await apiService.getSingleUser(userId);
|
user['user_id'].toString(),
|
||||||
context.go("/CreateTravelAgent", extra: {
|
);
|
||||||
"selectedUser": usersData,
|
final usersData = await apiService
|
||||||
"isViewMode": false,
|
.getSingleUser(userId);
|
||||||
});
|
context.go(
|
||||||
|
"/CreateTravelAgent",
|
||||||
|
extra: {
|
||||||
|
"selectedUser": usersData,
|
||||||
|
"isViewMode": false,
|
||||||
|
},
|
||||||
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -911,32 +917,48 @@ class _TravelAgentListScreenState extends State<TravelAgentListScreen> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment:
|
||||||
MainAxisAlignment.start,
|
MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
child: Tooltip(
|
child: Tooltip(
|
||||||
message: 'Edit Travel Agent Details',
|
message:
|
||||||
child: Image.asset(
|
'Edit Travel Agent Details',
|
||||||
'assets/images/IconsImg/edit.png',
|
child: Image.asset(
|
||||||
width: 20,
|
'assets/images/IconsImg/edit.png',
|
||||||
height: 15,
|
width: 20,
|
||||||
),
|
height: 15,
|
||||||
),
|
),
|
||||||
onTap: () async {
|
),
|
||||||
Navigator.pop(context); // Close the menu
|
onTap: () async {
|
||||||
final userId = int.parse(user['user_id'].toString());
|
// Navigator.pop(context); // Close the menu
|
||||||
final usersData = await apiService.getSingleUser(userId);
|
// final userId = user['user_id'];
|
||||||
context.go("/CreateTravelAgent", extra: {
|
final userId = int.parse(
|
||||||
|
user['user_id'].toString(),
|
||||||
|
);
|
||||||
|
final usersData = await apiService
|
||||||
|
.getSingleUser(userId);
|
||||||
|
context.go(
|
||||||
|
"/CreateTravelAgent",
|
||||||
|
extra: {
|
||||||
"selectedUser": usersData,
|
"selectedUser": usersData,
|
||||||
"isViewMode": false,
|
"isViewMode": false,
|
||||||
});
|
},
|
||||||
},
|
);
|
||||||
),
|
},
|
||||||
],
|
// onTap: () async {
|
||||||
),
|
// Navigator.pop(context); // Close the menu
|
||||||
|
// final userId = int.parse(user['user_id'].toString());
|
||||||
|
// final usersData = await apiService.getSingleUser(userId);
|
||||||
|
// context.go("/CreateTravelAgent", extra: {
|
||||||
|
// "selectedUser": usersData,
|
||||||
|
// "isViewMode": false,
|
||||||
|
// });
|
||||||
|
// },
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
// UserActionsMenu(
|
// UserActionsMenu(
|
||||||
// user: user,
|
// user: user,
|
||||||
// getUserDetails:
|
// getUserDetails:
|
||||||
@ -1043,7 +1065,7 @@ class _TravelAgentListScreenState extends State<TravelAgentListScreen> {
|
|||||||
children: [
|
children: [
|
||||||
Column(
|
Column(
|
||||||
crossAxisAlignment:
|
crossAxisAlignment:
|
||||||
CrossAxisAlignment.start,
|
CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"${user['company_name'] ?? ''}",
|
"${user['company_name'] ?? ''}",
|
||||||
|
|||||||
@ -806,7 +806,10 @@ class PersonalDetailsState extends State<PersonalDetails> {
|
|||||||
CustomTextFieldUserWrapper(
|
CustomTextFieldUserWrapper(
|
||||||
isFocused: focusStates["FnameFocused"] ?? false,
|
isFocused: focusStates["FnameFocused"] ?? false,
|
||||||
isDesktop: widget.isDesktop,
|
isDesktop: widget.isDesktop,
|
||||||
width: MediaQuery.of(context).size.width * 0.12,
|
width:
|
||||||
|
widget.isDesktop
|
||||||
|
? MediaQuery.of(context).size.width * 0.12
|
||||||
|
: null,
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: 40,
|
height: 40,
|
||||||
child: TextField(
|
child: TextField(
|
||||||
@ -858,7 +861,10 @@ class PersonalDetailsState extends State<PersonalDetails> {
|
|||||||
CustomTextFieldUserWrapper(
|
CustomTextFieldUserWrapper(
|
||||||
isFocused: focusStates["LnameFocused"] ?? false,
|
isFocused: focusStates["LnameFocused"] ?? false,
|
||||||
isDesktop: widget.isDesktop,
|
isDesktop: widget.isDesktop,
|
||||||
width: MediaQuery.of(context).size.width * 0.12,
|
width:
|
||||||
|
widget.isDesktop
|
||||||
|
? MediaQuery.of(context).size.width * 0.12
|
||||||
|
: null,
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: 40,
|
height: 40,
|
||||||
child: TextField(
|
child: TextField(
|
||||||
@ -1210,7 +1216,10 @@ class PersonalDetailsState extends State<PersonalDetails> {
|
|||||||
CustomTextFieldUserWrapper(
|
CustomTextFieldUserWrapper(
|
||||||
isFocused: focusStates["mobileNumberFocused"] ?? false,
|
isFocused: focusStates["mobileNumberFocused"] ?? false,
|
||||||
isDesktop: widget.isDesktop,
|
isDesktop: widget.isDesktop,
|
||||||
width: MediaQuery.of(context).size.width * 0.12,
|
width:
|
||||||
|
widget.isDesktop
|
||||||
|
? MediaQuery.of(context).size.width * 0.12
|
||||||
|
: null,
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: 40,
|
height: 40,
|
||||||
child: TextField(
|
child: TextField(
|
||||||
@ -1274,7 +1283,10 @@ class PersonalDetailsState extends State<PersonalDetails> {
|
|||||||
// isFocused: false,
|
// isFocused: false,
|
||||||
isFocused: focusStates["alternateMobileFocused"] ?? false,
|
isFocused: focusStates["alternateMobileFocused"] ?? false,
|
||||||
isDesktop: widget.isDesktop,
|
isDesktop: widget.isDesktop,
|
||||||
width: MediaQuery.of(context).size.width * 0.12,
|
width:
|
||||||
|
widget.isDesktop
|
||||||
|
? MediaQuery.of(context).size.width * 0.12
|
||||||
|
: null,
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: 40,
|
height: 40,
|
||||||
child: TextField(
|
child: TextField(
|
||||||
@ -1353,161 +1365,175 @@ class PersonalDetailsState extends State<PersonalDetails> {
|
|||||||
padding: const EdgeInsets.symmetric(horizontal: 0),
|
padding: const EdgeInsets.symmetric(horizontal: 0),
|
||||||
isDesktop: widget.isDesktop,
|
isDesktop: widget.isDesktop,
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: 40,
|
height: 40,
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
child: Focus(
|
child: Focus(
|
||||||
focusNode: focusNodes["countryFocusNode"],
|
focusNode: focusNodes["countryFocusNode"],
|
||||||
onFocusChange: (hasFocus) {
|
onFocusChange: (hasFocus) {
|
||||||
setState(() {
|
setState(() {
|
||||||
focusStates["countryFocused"] = hasFocus;
|
focusStates["countryFocused"] = hasFocus;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
// Request focus when user taps
|
// Request focus when user taps
|
||||||
focusNodes["countryFocusNode"]?.requestFocus();
|
focusNodes["countryFocusNode"]?.requestFocus();
|
||||||
},
|
|
||||||
child: DropdownSearch<String>(
|
|
||||||
selectedItem: countryMap[selectedCountry],
|
|
||||||
enabled: !widget.isViewMode,
|
|
||||||
popupProps: PopupProps.menu(
|
|
||||||
showSearchBox: true, // Enables search functionality
|
|
||||||
fit: FlexFit.loose, // Allows flexible height
|
|
||||||
menuProps: const MenuProps(backgroundColor: Colors.white),
|
|
||||||
itemBuilder:
|
|
||||||
// (context, item, isSelected) => Container(
|
|
||||||
// padding: EdgeInsets.symmetric(
|
|
||||||
// horizontal: 10,
|
|
||||||
// vertical: 6,
|
|
||||||
// ),
|
|
||||||
// child: Text(
|
|
||||||
// item,
|
|
||||||
// style: GoogleFonts.poppins(fontSize: 11.5),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
(context, item, isSelected) {
|
|
||||||
print("contryItem - $item");
|
|
||||||
final match = RegExp(r'^(.*)\s\((.*)\)$').firstMatch(item);
|
|
||||||
final countryName = match?.group(1) ?? '';
|
|
||||||
final countryCode = match?.group(2) ?? '';
|
|
||||||
return Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(
|
|
||||||
horizontal: 10.0,
|
|
||||||
vertical: 6.0,
|
|
||||||
),
|
|
||||||
child: Padding(
|
|
||||||
// padding: const EdgeInsets.all(3.0),
|
|
||||||
padding: EdgeInsets.symmetric(horizontal: 2, vertical: 3),
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
countryName,
|
|
||||||
style: GoogleFonts.poppins(fontSize: 11.5),
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
countryCode,
|
|
||||||
style: GoogleFonts.poppins(
|
|
||||||
fontSize: 11.5,
|
|
||||||
color: Colors.grey,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
constraints: BoxConstraints(maxHeight: 180),
|
child: DropdownSearch<String>(
|
||||||
searchFieldProps: TextFieldProps(
|
selectedItem: countryMap[selectedCountry],
|
||||||
decoration: InputDecoration(
|
enabled: !widget.isViewMode,
|
||||||
hintText: "Search Country...",
|
popupProps: PopupProps.menu(
|
||||||
contentPadding: EdgeInsets.symmetric(
|
showSearchBox: true, // Enables search functionality
|
||||||
horizontal: 3,
|
fit: FlexFit.loose, // Allows flexible height
|
||||||
vertical: 3,
|
menuProps: const MenuProps(backgroundColor: Colors.white),
|
||||||
),
|
itemBuilder:
|
||||||
),
|
// (context, item, isSelected) => Container(
|
||||||
),
|
// padding: EdgeInsets.symmetric(
|
||||||
),
|
// horizontal: 10,
|
||||||
items: countryMap.values.toList(),
|
// vertical: 6,
|
||||||
dropdownDecoratorProps: DropDownDecoratorProps(
|
// ),
|
||||||
dropdownSearchDecoration: InputDecoration(
|
// child: Text(
|
||||||
// border: InputBorder.none,
|
// item,
|
||||||
border: OutlineInputBorder(
|
// style: GoogleFonts.poppins(fontSize: 11.5),
|
||||||
borderRadius: BorderRadius.circular(8),
|
// ),
|
||||||
borderSide: BorderSide(
|
// ),
|
||||||
color:
|
(context, item, isSelected) {
|
||||||
(focusStates["countryFocused"] ?? false)
|
print("contryItem - $item");
|
||||||
? (layoutColor ?? Colors.blue)
|
final match = RegExp(
|
||||||
: Colors.white,
|
r'^(.*)\s\((.*)\)$',
|
||||||
// width: 0.5,
|
).firstMatch(item);
|
||||||
),
|
final countryName = match?.group(1) ?? '';
|
||||||
),
|
final countryCode = match?.group(2) ?? '';
|
||||||
enabledBorder: OutlineInputBorder(
|
return Padding(
|
||||||
borderSide: BorderSide(
|
padding: const EdgeInsets.symmetric(
|
||||||
color:
|
horizontal: 10.0,
|
||||||
(focusStates["countryFocused"] ?? false)
|
vertical: 6.0,
|
||||||
? (layoutColor ?? Colors.blue)
|
),
|
||||||
: Colors.white,
|
child: Padding(
|
||||||
// width: 0.5,
|
// padding: const EdgeInsets.all(3.0),
|
||||||
// const Color(0xFFD6D5E6),
|
padding: EdgeInsets.symmetric(
|
||||||
),
|
horizontal: 2,
|
||||||
),
|
vertical: 3,
|
||||||
focusedBorder: OutlineInputBorder(
|
),
|
||||||
borderSide: BorderSide(
|
child: Row(
|
||||||
color : (layoutColor ?? Colors.grey), width: 1),
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
),
|
children: [
|
||||||
contentPadding: EdgeInsets.symmetric(horizontal: 10.0, vertical: 8.0,),
|
Text(
|
||||||
// contentPadding: EdgeInsets.symmetric(horizontal: 1),
|
countryName,
|
||||||
),
|
style: GoogleFonts.poppins(fontSize: 11.5),
|
||||||
),
|
),
|
||||||
dropdownBuilder:
|
Text(
|
||||||
(context, selectedItem) => Align(
|
countryCode,
|
||||||
// Center-align selected item
|
style: GoogleFonts.poppins(
|
||||||
alignment: Alignment.centerLeft,
|
fontSize: 11.5,
|
||||||
child: Text(
|
color: Colors.grey,
|
||||||
selectedItem ?? "Select Country",
|
),
|
||||||
style: GoogleFonts.poppins(
|
),
|
||||||
fontSize: 12,
|
],
|
||||||
color: Colors.black,
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
constraints: BoxConstraints(maxHeight: 180),
|
||||||
|
searchFieldProps: TextFieldProps(
|
||||||
|
decoration: InputDecoration(
|
||||||
|
hintText: "Search Country...",
|
||||||
|
contentPadding: EdgeInsets.symmetric(
|
||||||
|
horizontal: 3,
|
||||||
|
vertical: 3,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
items: countryMap.values.toList(),
|
||||||
|
dropdownDecoratorProps: DropDownDecoratorProps(
|
||||||
|
dropdownSearchDecoration: InputDecoration(
|
||||||
|
// border: InputBorder.none,
|
||||||
|
border: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color:
|
||||||
|
(focusStates["countryFocused"] ?? false)
|
||||||
|
? (layoutColor ?? Colors.blue)
|
||||||
|
: Colors.white,
|
||||||
|
// width: 0.5,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
enabledBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color:
|
||||||
|
(focusStates["countryFocused"] ?? false)
|
||||||
|
? (layoutColor ?? Colors.blue)
|
||||||
|
: Colors.white,
|
||||||
|
// width: 0.5,
|
||||||
|
// const Color(0xFFD6D5E6),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
focusedBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: (layoutColor ?? Colors.grey),
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
contentPadding: EdgeInsets.symmetric(
|
||||||
|
horizontal: 10.0,
|
||||||
|
vertical: 8.0,
|
||||||
|
),
|
||||||
|
// contentPadding: EdgeInsets.symmetric(horizontal: 1),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
dropdownBuilder:
|
||||||
|
(context, selectedItem) => Align(
|
||||||
|
// Center-align selected item
|
||||||
|
alignment: Alignment.centerLeft,
|
||||||
|
child: Text(
|
||||||
|
selectedItem ?? "Select Country",
|
||||||
|
style: GoogleFonts.poppins(
|
||||||
|
fontSize: 12,
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
// onChanged: widget.isViewMode
|
// onChanged: widget.isViewMode
|
||||||
// ? null
|
// ? null
|
||||||
// : (String? newValue) {
|
// : (String? newValue) {
|
||||||
// setState(() {
|
// setState(() {
|
||||||
// // Find the country_code based on selected country_name
|
// // Find the country_code based on selected country_name
|
||||||
// selectedCountry = countryMap.entries
|
// selectedCountry = countryMap.entries
|
||||||
// .firstWhere((entry) => entry.value == newValue)
|
// .firstWhere((entry) => entry.value == newValue)
|
||||||
// .key;
|
// .key;
|
||||||
//
|
//
|
||||||
// // if (selectedCountry!.isNotEmpty) {
|
// // if (selectedCountry!.isNotEmpty) {
|
||||||
// // errorMessages.remove("country_code");
|
// // errorMessages.remove("country_code");
|
||||||
// // }
|
// // }
|
||||||
// });
|
// });
|
||||||
// widget.onCountryChanged?.call(newValue);
|
// widget.onCountryChanged?.call(newValue);
|
||||||
// },
|
// },
|
||||||
onChanged:
|
onChanged:
|
||||||
widget.isViewMode
|
widget.isViewMode
|
||||||
? null
|
? null
|
||||||
: (String? newValue) {
|
: (String? newValue) {
|
||||||
if (newValue == null) return;
|
if (newValue == null) return;
|
||||||
|
|
||||||
final countryCode =
|
final countryCode =
|
||||||
countryMap.entries
|
countryMap.entries
|
||||||
.firstWhere((entry) => entry.value == newValue)
|
.firstWhere(
|
||||||
.key;
|
(entry) => entry.value == newValue,
|
||||||
|
)
|
||||||
|
.key;
|
||||||
|
|
||||||
setState(() {
|
setState(() {
|
||||||
selectedCountry = countryCode;
|
selectedCountry = countryCode;
|
||||||
});
|
});
|
||||||
|
|
||||||
widget.onCountryChanged?.call(
|
widget.onCountryChanged?.call(
|
||||||
countryCode,
|
countryCode,
|
||||||
); // ✅ send code not name
|
); // ✅ send code not name
|
||||||
},
|
},
|
||||||
),),),
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@ -388,32 +388,35 @@ class OfficeDetailsState extends State<OfficeDetails> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Column(
|
child: SingleChildScrollView(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
scrollDirection: Axis.vertical,
|
||||||
children: [
|
child: Column(
|
||||||
SizedBox(height: 20),
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
_buildFirstRow(widget.isDesktop),
|
children: [
|
||||||
if (widget.isDesktop) SizedBox(height: 10),
|
SizedBox(height: 20),
|
||||||
_buildSecondRow(widget.isDesktop),
|
_buildFirstRow(widget.isDesktop),
|
||||||
if (widget.isDesktop) SizedBox(height: 10),
|
if (widget.isDesktop) SizedBox(height: 10),
|
||||||
_buildThirdRow(widget.isDesktop),
|
_buildSecondRow(widget.isDesktop),
|
||||||
if (widget.isDesktop) SizedBox(height: 10),
|
if (widget.isDesktop) SizedBox(height: 10),
|
||||||
Divider(thickness: 0.2, color: Colors.blueGrey.shade100),
|
_buildThirdRow(widget.isDesktop),
|
||||||
Row(
|
if (widget.isDesktop) SizedBox(height: 10),
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
Divider(thickness: 0.2, color: Colors.blueGrey.shade100),
|
||||||
children: [
|
Row(
|
||||||
Text(
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
"Delegation",
|
children: [
|
||||||
style: GoogleFonts.poppins(
|
Text(
|
||||||
fontSize: 12,
|
"Delegation",
|
||||||
fontWeight: FontWeight.w500,
|
style: GoogleFonts.poppins(
|
||||||
|
fontSize: 12,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
SizedBox(height: 15),
|
||||||
SizedBox(height: 15),
|
_buildFourthRow(widget.isDesktop),
|
||||||
_buildFourthRow(widget.isDesktop),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user