flight changes

This commit is contained in:
venbaittech 2025-06-25 11:18:33 +05:30
parent eee3182898
commit 29e30d3452
5 changed files with 61 additions and 71 deletions

View File

@ -657,27 +657,28 @@ class FlightScreenState extends State<FlightScreen> {
Set<String?> seenFrom = {}; Set<String?> seenFrom = {};
Set<String?> seenTo = {}; Set<String?> seenTo = {};
for (int i = 1; i <= rowCount; i++) { if (selectedTripType == "Roundtrip") {
final fromValue = selectedFrom[i]; for (int i = 1; i <= rowCount; i++) {
final toValue = selectedTo[i]; final fromValue = selectedFrom[i];
if (fromValue != null) { final toValue = selectedTo[i];
if (seenFrom.contains(fromValue)) { if (fromValue != null) {
errorMessages["from_place_$i"] = "Duplicate Departure "; if (seenFrom.contains(fromValue)) {
print("Error: from_place_$i duplicates a previous departure"); errorMessages["from_place_$i"] = "Duplicate Departure ";
} else { print("Error: from_place_$i duplicates a previous departure");
seenFrom.add(fromValue); } else {
seenFrom.add(fromValue);
// errorMessages.remove("from_place_$i"); // errorMessages.remove("from_place_$i");
}
} }
} if (toValue != null) {
if (seenTo.contains(toValue)) {
if (toValue != null) { errorMessages["to_place_$i"] = "Duplicate Destination ";
if (seenTo.contains(toValue)) { print("Error: to_place_$i duplicates a previous departure");
errorMessages["to_place_$i"] = "Duplicate Destination "; } else {
print("Error: to_place_$i duplicates a previous departure"); // errorMessages.remove("to_place_$i");
} else { seenTo.add(toValue);
// errorMessages.remove("to_place_$i"); }
seenTo.add(toValue);
} }
} }
} }

View File

@ -273,11 +273,13 @@ class _ForexScreenState extends State<ForexScreen> {
// Check if card_number has at least 16 digits // Check if card_number has at least 16 digits
} }
final cardNumber = data["card_number"]?.toString() ?? ''; if (!isCardChecked) {
if (cardNumber.length < 16) { final cardNumber = data["card_number"]?.toString() ?? '';
// Show error or return false if (cardNumber.length < 15) {
print("Card number must be 16 digits"); // Show error or return false
errorMessages["card_number"] = "Card number must be 16 digits"; print("Card number must be 15 digits");
errorMessages["card_number"] = "Card number must be atleat 15 digits";
}
} }
// Check validation for each field // Check validation for each field
@ -2328,6 +2330,8 @@ class _ForexScreenState extends State<ForexScreen> {
), ),
onChanged: (bool? value) { onChanged: (bool? value) {
setState(() { setState(() {
errorMessages.remove("card_number");
isChecked = value!; isChecked = value!;
// if (isChecked) { // if (isChecked) {
// textControllers["_cardNumber"] // textControllers["_cardNumber"]

View File

@ -1291,7 +1291,10 @@ class PersonalDetailsState extends State<PersonalDetails> {
searchFieldProps: TextFieldProps( searchFieldProps: TextFieldProps(
decoration: InputDecoration( decoration: InputDecoration(
hintText: "Search Country...", hintText: "Search Country...",
contentPadding: EdgeInsets.symmetric(horizontal: 3,vertical: 3), contentPadding: EdgeInsets.symmetric(
horizontal: 3,
vertical: 3,
),
), ),
), ),
), ),

View File

@ -795,28 +795,6 @@ class _CreateUserFormDetialsState extends State<CreateUserFormDetials> {
print("All tabs completed!"); print("All tabs completed!");
// Submit the full form here // Submit the full form here
} }
// if (!isValidData(data))
// {
// print("USERDETAILS : $userDetials");
// print("Validation Failed: Required fields are missing.");
// setState(() {});
// return; // Stop execution if validation fails
// } else
// {
// print("USERDETAILS : $userDetials");
//
// if (currentIndex < tabKeys.length - 1) {
// // Move to next tab
// setState(() {
// selectedTab = tabKeys[currentIndex + 1];
// });
// } else {
// // Already at last tab (travel), maybe submit form or show done message
// print("All tabs completed!");
// // You can trigger full form submit here
// }
// }
} }
void handleSubmit() async { void handleSubmit() async {
@ -1351,30 +1329,29 @@ class _CreateUserFormDetialsState extends State<CreateUserFormDetials> {
Row( Row(
children: [ children: [
apiselectedUser != null apiselectedUser != null
? Text( "Profile", ? Text(
style: GoogleFonts.poppins( "Profile",
fontSize: isDesktop ? 15 : 12, style: GoogleFonts.poppins(
fontWeight: FontWeight.w600, fontSize: isDesktop ? 15 : 12,
color: Colors.black, fontWeight: FontWeight.w600,
), color: Colors.black,
)
: Container(
child: BreadcrumbNavigation(
isDesktop: isDesktop,
breadcrumbItems: [
BreadcrumbItem(
title: 'Users',
tooltip: 'Go To Users',
onTap: (context) {
context.go("/listUser");
}
),
BreadcrumbItem(
title: 'Create New User',
),
],
),
), ),
)
: Container(
child: BreadcrumbNavigation(
isDesktop: isDesktop,
breadcrumbItems: [
BreadcrumbItem(
title: 'Users',
tooltip: 'Go To Users',
onTap: (context) {
context.go("/listUser");
},
),
BreadcrumbItem(title: 'Create New User'),
],
),
),
// Text( // Text(
// apiselectedUser != null ? "Profile" : "Create New User", // apiselectedUser != null ? "Profile" : "Create New User",
// style: GoogleFonts.poppins( // style: GoogleFonts.poppins(

View File

@ -282,6 +282,7 @@ class TravellerDetailsState extends State<TravellerDetails> {
value, value,
userId, userId,
); );
if (response.isNotEmpty) { if (response.isNotEmpty) {
_clearError(field); _clearError(field);
errorMessages[field] = response['message'] ?? "$label Already Exists"; errorMessages[field] = response['message'] ?? "$label Already Exists";
@ -1261,7 +1262,11 @@ class TravellerDetailsState extends State<TravellerDetails> {
} }
Widget buildNationality() { Widget buildNationality() {
List<String> nationalityOptions = ["Indian", "International","other nationality"]; List<String> nationalityOptions = [
"Indian",
"International",
"other nationality",
];
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [