diff --git a/lib/Screens/userManagement/create_user/create_user.dart b/lib/Screens/userManagement/create_user/create_user.dart index cff5d90..10168c7 100644 --- a/lib/Screens/userManagement/create_user/create_user.dart +++ b/lib/Screens/userManagement/create_user/create_user.dart @@ -546,6 +546,33 @@ class _CreateUserFormDetialsState extends State { 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 { print("USR Detail Next"); printFormData(); @@ -959,15 +986,26 @@ class _CreateUserFormDetialsState extends State { isDesktop ? Row( mainAxisAlignment: MainAxisAlignment.end, - children: - (selectedTab == "travel" || - selectedRole == "5" || - setSelectesUserType == true) - ? _buildSubmit(isDesktop, layoutColor!) - : _buildNext( - isDesktop, - layoutColor!, - ), // _buildGoBack(isDesktop, layoutColor!), + children: [ + if (selectedTab != "personal") + ..._buildBack(isDesktop, layoutColor!), + Spacer(), // spacing between buttons + // Next or Submit based on role or user type + if (selectedTab == "travel" || + selectedRole == "5" || + setSelectesUserType == true) + ..._buildSubmit(isDesktop, layoutColor!) + else + ..._buildNext(isDesktop, layoutColor!), + // (selectedTab == "travel" || + // selectedRole == "5" || + // setSelectesUserType == true) + // ? _buildSubmit(isDesktop, layoutColor!) + // : _buildNext( + // isDesktop, + // layoutColor!, + // ), // _buildGoBack(isDesktop, layoutColor!), + ], ) : Row( mainAxisAlignment: MainAxisAlignment.end, @@ -1325,22 +1363,22 @@ class _CreateUserFormDetialsState extends State { child: TextButton( style: ElevatedButton.styleFrom( backgroundColor: - isViewMode ? layoutColor : layoutColor, // Keep original color + isViewMode ? Colors.white : Colors.white, // Keep original color foregroundColor: - isViewMode ? Colors.white : Colors.red, // Keep original color + isViewMode ? layoutColor : layoutColor, // Keep original color disabledBackgroundColor: layoutColor, // Ensure color remains when disabled disabledForegroundColor: Colors.white, shape: RoundedRectangleBorder( 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: // isViewMode ? null : handleNext, // Disable when in view mode - child: Text("Next"), + child: Text("Back"), ), ), ]; diff --git a/lib/Screens/userManagement/create_user/traveller_details.dart b/lib/Screens/userManagement/create_user/traveller_details.dart index ffec240..0aab581 100644 --- a/lib/Screens/userManagement/create_user/traveller_details.dart +++ b/lib/Screens/userManagement/create_user/traveller_details.dart @@ -106,6 +106,8 @@ class TravellerDetailsState extends State { //To Create Controllers List dataHeader = [ "Fname", + "Mname", + "Lname", "nationality", "d_meal_pref", @@ -900,49 +902,52 @@ class TravellerDetailsState extends State { Widget _buildPassportDataRow1(bool isDesktop) { return Container( color: Colors.white, - child: Row( - children: [ - Text( - "Name as per passport : ", - style: GoogleFonts.poppins( - fontSize: 11, - fontStyle: FontStyle.italic, - letterSpacing: 0.5, - ), - ), - Text( - "${widget.fullName} ", - style: GoogleFonts.poppins( - fontSize: 10, - fontWeight: FontWeight.w600, - letterSpacing: 0.5, - color: Colors.black87, - // fontStyle: FontStyle.italic, - ), - ), - ], - ), - // child: widget.isDesktop - // ? Row( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // buildFirstNameField(), - // Spacer(), - // buildLastNameField(), - // Spacer(), // Space after Last Name - // buildNationality(), - // ], - // ) - // : Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // buildFirstNameField(), - // SizedBox(height: 8), // Vertical space - // buildLastNameField(), - // SizedBox(height: 8), - // buildNationality(), - // ], - // ), + // child: Row( + // children: [ + // Text( + // "Name as per passport : ", + // style: GoogleFonts.poppins( + // fontSize: 11, + // fontStyle: FontStyle.italic, + // letterSpacing: 0.5, + // ), + // ), + // Text( + // "${widget.fullName} ", + // style: GoogleFonts.poppins( + // fontSize: 10, + // fontWeight: FontWeight.w600, + // letterSpacing: 0.5, + // color: Colors.black87, + // // fontStyle: FontStyle.italic, + // ), + // ), + // ], + // ), + child: + widget.isDesktop + ? Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + buildFirstNameField(), + Spacer(), buildMiddleNameField(), + Spacer(), + buildLastNameField(), + SizedBox(width: 25), // Space after Last Name + buildNationality(), + ], + ) + : Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + buildFirstNameField(), + SizedBox(height: 8), buildMiddleNameField(), + SizedBox(height: 8), // Vertical space + buildLastNameField(), + SizedBox(height: 8), + buildNationality(), + ], + ), ); } @@ -1039,6 +1044,48 @@ class TravellerDetailsState extends State { ); } + 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() { return Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -1054,6 +1101,10 @@ class TravellerDetailsState extends State { SizedBox(height: 5), CustomTextFieldUserTravellerWrapper( isFocused: false, + width: + widget.isDesktop + ? MediaQuery.of(context).size.width * 0.13 + : null, isDesktop: widget.isDesktop, child: SizedBox( height: 40, @@ -1096,6 +1147,10 @@ class TravellerDetailsState extends State { SizedBox(height: 5), CustomTextFieldUserTravellerWrapper( isFocused: false, + width: + widget.isDesktop + ? MediaQuery.of(context).size.width * 0.13 + : null, isDesktop: widget.isDesktop, child: SizedBox( height: 40, @@ -2789,7 +2844,7 @@ class TravellerDetailsState extends State { controller: entry["controller_flier_number"], enabled: !widget.isViewMode, onChanged: (value) { - _clearError("first_name"); + // _clearError("first_name"); }, decoration: InputDecoration( labelText: "Frequent Flyer Information", @@ -3053,7 +3108,7 @@ class TravellerDetailsState extends State { controller: entry["controller_membership"], enabled: !widget.isViewMode, onChanged: (value) { - _clearError("first_name"); + // _clearError("first_name"); }, decoration: InputDecoration( labelText: "Hotel Membership Number", diff --git a/lib/routes/custom_appBar.dart b/lib/routes/custom_appBar.dart index 8539d59..5991209 100644 --- a/lib/routes/custom_appBar.dart +++ b/lib/routes/custom_appBar.dart @@ -321,8 +321,13 @@ class _CustomAppBarState extends State { errorBuilder: (context, error, stackTrace) { return const CircleAvatar( radius: 20, - backgroundColor: Colors.redAccent, - child: Icon(Icons.error, size: 10), + child: Icon( + 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 { ), ), SizedBox(width: MediaQuery.of(context).size.width * 0.18), + // Spacer(), Container( width: MediaQuery.of(context).size.width * 0.35, child: Row( diff --git a/lib/routes/organizationSetting.dart b/lib/routes/organizationSetting.dart index c06b3d9..ec624fa 100644 --- a/lib/routes/organizationSetting.dart +++ b/lib/routes/organizationSetting.dart @@ -112,9 +112,9 @@ class OrganizationSettingState extends State { }, { 'value': '/forexTexmplate', - 'icon': Icons.attach_money, - 'label': 'Forex Template', - 'description': 'Edit Template', + 'icon': Icons.credit_card, + 'label': 'Forex Documentation', + 'description': 'Edit Document', }, { 'value': '/templateList',