// import 'dart:io' as html;
import 'dart:io' as io;
import 'package:dropdown_search/dropdown_search.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:frontend/utils/auth_utils.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:intl/intl.dart';
import 'package:universal_html/html.dart' as html;
import 'dart:async';
import 'dart:typed_data'; // Import for Uint8List
import 'package:flutter/foundation.dart';
import '../../../config/apiUrl.dart';
import '../../../services/apiService.dart';
import '../../../widgets/custom_user_form.dart';
import '../../../widgets/custom_user_form.dart';
import '../../../widgets/custom_user_travel.dart';
class TravellerDetails extends StatefulWidget {
final bool isDesktop;
final Map controllers;
final Map errorMessages;
final bool isViewMode;
final Map? travelDetails;
final String? passportFileUrlFromApi;
final String? userIdApi;
final String fullName;
const TravellerDetails({
Key? key,
required this.controllers,
required this.errorMessages,
required this.isDesktop,
required this.isViewMode,
this.travelDetails,
this.passportFileUrlFromApi,
this.userIdApi,
required this.fullName,
}) : super(key: key);
@override
TravellerDetailsState createState() => TravellerDetailsState();
}
class TravellerDetailsState extends State {
final ApiService apiService = ApiService();
html.File? passportFile;
late List isExpandedList;
int? expandedIndex;
bool isCountryLoading = true;
Map errorMessages = {};
late final userId;
String? selectedFileNames;
Uint8List? passportDocumentBytes;
String? passportFileUrlFromApi;
String? _selectedTripType;
// String? selectedPurpose;
// String? selectedCountry;
String? selectedLocalIdType;
List countryList = [];
String? selectedDomesticSeat;
String? selectedIntenationalSeat;
String? SelectedIdType;
Map airlineControllers = {};
Map flierNumberControllers = {};
List