user changes

This commit is contained in:
venbaittech 2025-06-06 13:59:38 +05:30
parent 194af031d0
commit a41402f929
4 changed files with 164 additions and 65 deletions

View File

@ -546,6 +546,33 @@ class _CreateUserFormDetialsState extends State<CreateUserFormDetials> {
printFormData(); printFormData();
} }
void handleBack() async {
print("USR Detail back");
final tabs = {
"personal": "Personal Details",
"office": "Office Details",
"travel": "Travel Details",
};
final tabKeys = tabs.keys.toList(); // ["personal", "office", "travel"]
final currentIndex = tabKeys.indexOf(selectedTab ?? "travel");
print("currentIndex - $currentIndex");
if (currentIndex > 0) {
// Move to next tab
setState(() {
selectedTab = tabKeys[currentIndex - 1];
});
} else {
// Final step submit or show done
print("All tabs completed!");
// Submit the full form here
}
}
void handleNext() async { void handleNext() async {
print("USR Detail Next"); print("USR Detail Next");
printFormData(); printFormData();
@ -959,15 +986,26 @@ class _CreateUserFormDetialsState extends State<CreateUserFormDetials> {
isDesktop isDesktop
? Row( ? Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: children: [
(selectedTab == "travel" || if (selectedTab != "personal")
selectedRole == "5" || ..._buildBack(isDesktop, layoutColor!),
setSelectesUserType == true) Spacer(), // spacing between buttons
? _buildSubmit(isDesktop, layoutColor!) // Next or Submit based on role or user type
: _buildNext( if (selectedTab == "travel" ||
isDesktop, selectedRole == "5" ||
layoutColor!, setSelectesUserType == true)
), // _buildGoBack(isDesktop, layoutColor!), ..._buildSubmit(isDesktop, layoutColor!)
else
..._buildNext(isDesktop, layoutColor!),
// (selectedTab == "travel" ||
// selectedRole == "5" ||
// setSelectesUserType == true)
// ? _buildSubmit(isDesktop, layoutColor!)
// : _buildNext(
// isDesktop,
// layoutColor!,
// ), // _buildGoBack(isDesktop, layoutColor!),
],
) )
: Row( : Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
@ -1325,22 +1363,22 @@ class _CreateUserFormDetialsState extends State<CreateUserFormDetials> {
child: TextButton( child: TextButton(
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
backgroundColor: backgroundColor:
isViewMode ? layoutColor : layoutColor, // Keep original color isViewMode ? Colors.white : Colors.white, // Keep original color
foregroundColor: foregroundColor:
isViewMode ? Colors.white : Colors.red, // Keep original color isViewMode ? layoutColor : layoutColor, // Keep original color
disabledBackgroundColor: disabledBackgroundColor:
layoutColor, // Ensure color remains when disabled layoutColor, // Ensure color remains when disabled
disabledForegroundColor: Colors.white, disabledForegroundColor: Colors.white,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
side: BorderSide(color: layoutColor, width: 2), side: BorderSide(color: Colors.white, width: 2),
), ),
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 12), padding: EdgeInsets.symmetric(horizontal: 20, vertical: 18),
), ),
onPressed: handleNext, onPressed: handleBack,
// onPressed: // onPressed:
// isViewMode ? null : handleNext, // Disable when in view mode // isViewMode ? null : handleNext, // Disable when in view mode
child: Text("Next"), child: Text("Back"),
), ),
), ),
]; ];

View File

@ -106,6 +106,8 @@ class TravellerDetailsState extends State<TravellerDetails> {
//To Create Controllers //To Create Controllers
List<String> dataHeader = [ List<String> dataHeader = [
"Fname", "Fname",
"Mname",
"Lname", "Lname",
"nationality", "nationality",
"d_meal_pref", "d_meal_pref",
@ -900,49 +902,52 @@ class TravellerDetailsState extends State<TravellerDetails> {
Widget _buildPassportDataRow1(bool isDesktop) { Widget _buildPassportDataRow1(bool isDesktop) {
return Container( return Container(
color: Colors.white, color: Colors.white,
child: Row( // child: Row(
children: [ // children: [
Text( // Text(
"Name as per passport : ", // "Name as per passport : ",
style: GoogleFonts.poppins( // style: GoogleFonts.poppins(
fontSize: 11, // fontSize: 11,
fontStyle: FontStyle.italic, // fontStyle: FontStyle.italic,
letterSpacing: 0.5, // letterSpacing: 0.5,
), // ),
), // ),
Text( // Text(
"${widget.fullName} ", // "${widget.fullName} ",
style: GoogleFonts.poppins( // style: GoogleFonts.poppins(
fontSize: 10, // fontSize: 10,
fontWeight: FontWeight.w600, // fontWeight: FontWeight.w600,
letterSpacing: 0.5, // letterSpacing: 0.5,
color: Colors.black87, // color: Colors.black87,
// fontStyle: FontStyle.italic, // // fontStyle: FontStyle.italic,
), // ),
), // ),
], // ],
), // ),
// child: widget.isDesktop child:
// ? Row( widget.isDesktop
// crossAxisAlignment: CrossAxisAlignment.start, ? Row(
// children: [ crossAxisAlignment: CrossAxisAlignment.start,
// buildFirstNameField(), children: [
// Spacer(), buildFirstNameField(),
// buildLastNameField(), Spacer(), buildMiddleNameField(),
// Spacer(), // Space after Last Name Spacer(),
// buildNationality(), buildLastNameField(),
// ], SizedBox(width: 25), // Space after Last Name
// ) buildNationality(),
// : Column( ],
// crossAxisAlignment: CrossAxisAlignment.start, )
// children: [ : Column(
// buildFirstNameField(), crossAxisAlignment: CrossAxisAlignment.start,
// SizedBox(height: 8), // Vertical space children: [
// buildLastNameField(), buildFirstNameField(),
// SizedBox(height: 8), SizedBox(height: 8), buildMiddleNameField(),
// buildNationality(), SizedBox(height: 8), // Vertical space
// ], buildLastNameField(),
// ), SizedBox(height: 8),
buildNationality(),
],
),
); );
} }
@ -1039,6 +1044,48 @@ class TravellerDetailsState extends State<TravellerDetails> {
); );
} }
Widget buildMiddleNameField() {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Middle Name",
style: GoogleFonts.poppins(
fontSize: 12,
fontWeight: FontWeight.w400,
color: Colors.black,
),
),
SizedBox(height: 5),
CustomTextFieldUserTravellerWrapper(
isFocused: false,
isDesktop: widget.isDesktop,
child: SizedBox(
height: 40,
child: TextField(
style: GoogleFonts.poppins(fontSize: 12, color: Colors.black),
controller: controllers["Mname"],
enabled: !widget.isViewMode,
onChanged: (value) {
_clearError("middle_name");
},
decoration: InputDecoration(
labelText: "MiddleName",
labelStyle: GoogleFonts.poppins(
fontSize: 12,
color: Colors.grey,
),
floatingLabelBehavior: FloatingLabelBehavior.never,
border: InputBorder.none,
contentPadding: EdgeInsets.symmetric(vertical: 16),
),
),
),
),
],
);
}
Widget buildLastNameField() { Widget buildLastNameField() {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -1054,6 +1101,10 @@ class TravellerDetailsState extends State<TravellerDetails> {
SizedBox(height: 5), SizedBox(height: 5),
CustomTextFieldUserTravellerWrapper( CustomTextFieldUserTravellerWrapper(
isFocused: false, isFocused: false,
width:
widget.isDesktop
? MediaQuery.of(context).size.width * 0.13
: null,
isDesktop: widget.isDesktop, isDesktop: widget.isDesktop,
child: SizedBox( child: SizedBox(
height: 40, height: 40,
@ -1096,6 +1147,10 @@ class TravellerDetailsState extends State<TravellerDetails> {
SizedBox(height: 5), SizedBox(height: 5),
CustomTextFieldUserTravellerWrapper( CustomTextFieldUserTravellerWrapper(
isFocused: false, isFocused: false,
width:
widget.isDesktop
? MediaQuery.of(context).size.width * 0.13
: null,
isDesktop: widget.isDesktop, isDesktop: widget.isDesktop,
child: SizedBox( child: SizedBox(
height: 40, height: 40,
@ -2789,7 +2844,7 @@ class TravellerDetailsState extends State<TravellerDetails> {
controller: entry["controller_flier_number"], controller: entry["controller_flier_number"],
enabled: !widget.isViewMode, enabled: !widget.isViewMode,
onChanged: (value) { onChanged: (value) {
_clearError("first_name"); // _clearError("first_name");
}, },
decoration: InputDecoration( decoration: InputDecoration(
labelText: "Frequent Flyer Information", labelText: "Frequent Flyer Information",
@ -3053,7 +3108,7 @@ class TravellerDetailsState extends State<TravellerDetails> {
controller: entry["controller_membership"], controller: entry["controller_membership"],
enabled: !widget.isViewMode, enabled: !widget.isViewMode,
onChanged: (value) { onChanged: (value) {
_clearError("first_name"); // _clearError("first_name");
}, },
decoration: InputDecoration( decoration: InputDecoration(
labelText: "Hotel Membership Number", labelText: "Hotel Membership Number",

View File

@ -321,8 +321,13 @@ class _CustomAppBarState extends State<CustomAppBar> {
errorBuilder: (context, error, stackTrace) { errorBuilder: (context, error, stackTrace) {
return const CircleAvatar( return const CircleAvatar(
radius: 20, radius: 20,
backgroundColor: Colors.redAccent, child: Icon(
child: Icon(Icons.error, size: 10), Icons.add_a_photo,
size: 10,
color: Colors.grey,
),
// backgroundColor: Colors.redAccent,
// child: Icon(Icons.error, size: 10),
); );
}, },
), ),
@ -339,6 +344,7 @@ class _CustomAppBarState extends State<CustomAppBar> {
), ),
), ),
SizedBox(width: MediaQuery.of(context).size.width * 0.18), SizedBox(width: MediaQuery.of(context).size.width * 0.18),
// Spacer(),
Container( Container(
width: MediaQuery.of(context).size.width * 0.35, width: MediaQuery.of(context).size.width * 0.35,
child: Row( child: Row(

View File

@ -112,9 +112,9 @@ class OrganizationSettingState extends State<OrganizationSetting> {
}, },
{ {
'value': '/forexTexmplate', 'value': '/forexTexmplate',
'icon': Icons.attach_money, 'icon': Icons.credit_card,
'label': 'Forex Template', 'label': 'Forex Documentation',
'description': 'Edit Template', 'description': 'Edit Document',
}, },
{ {
'value': '/templateList', 'value': '/templateList',