merge with old
This commit is contained in:
commit
5a3c2a7fb9
File diff suppressed because it is too large
Load Diff
@ -42,9 +42,9 @@ class _CreateUserFormDetialsState extends State<CreateUserFormDetials> {
|
||||
final ApiService apiService = ApiService();
|
||||
|
||||
final GlobalKey<PersonalDetailsState> personalDetailsKey =
|
||||
GlobalKey<PersonalDetailsState>();
|
||||
GlobalKey<PersonalDetailsState>();
|
||||
final GlobalKey<TravellerDetailsState> travellerDetailsKey =
|
||||
GlobalKey<TravellerDetailsState>();
|
||||
GlobalKey<TravellerDetailsState>();
|
||||
|
||||
// late List<Map<String, dynamic>?> travelDetailsData;
|
||||
Map<String, dynamic>? travelDetailsData;
|
||||
@ -299,7 +299,7 @@ class _CreateUserFormDetialsState extends State<CreateUserFormDetials> {
|
||||
// Fix the invalid JSON (dangerous if the format changes)
|
||||
final fixedJson = raw.replaceAllMapped(
|
||||
RegExp(r'(\w+):'), // matches `service_id:`
|
||||
(match) => '"${match.group(1)}":',
|
||||
(match) => '"${match.group(1)}":',
|
||||
);
|
||||
|
||||
List<dynamic> decodedList = jsonDecode(fixedJson);
|
||||
@ -363,7 +363,7 @@ class _CreateUserFormDetialsState extends State<CreateUserFormDetials> {
|
||||
// }
|
||||
|
||||
final extraData =
|
||||
GoRouterState.of(context).extra as Map<String, dynamic>?;
|
||||
GoRouterState.of(context).extra as Map<String, dynamic>?;
|
||||
|
||||
if (extraData != null) {
|
||||
print("extraData: ${extraData['selectedUser']}");
|
||||
@ -381,8 +381,8 @@ class _CreateUserFormDetialsState extends State<CreateUserFormDetials> {
|
||||
|
||||
// Handle selectedUser as a Map (not a List)
|
||||
apiselectedUser =
|
||||
extraData['selectedUser']
|
||||
as Map<String, dynamic>?; // Cast it as a Map
|
||||
extraData['selectedUser']
|
||||
as Map<String, dynamic>?; // Cast it as a Map
|
||||
isViewMode = extraData['isViewMode'] ?? false;
|
||||
isEditProfile = extraData['isEditProfile'] ?? false;
|
||||
});
|
||||
@ -444,7 +444,7 @@ class _CreateUserFormDetialsState extends State<CreateUserFormDetials> {
|
||||
userMap = {
|
||||
for (var user in userList)
|
||||
user['user_id'].toString():
|
||||
"${user['first_name']} ${user['last_name']}",
|
||||
"${user['first_name']} ${user['last_name']}",
|
||||
};
|
||||
userIdsApi = userMap.keys.toList();
|
||||
});
|
||||
@ -483,14 +483,14 @@ class _CreateUserFormDetialsState extends State<CreateUserFormDetials> {
|
||||
|
||||
setState(() {
|
||||
layoutColor =
|
||||
layoutString != null
|
||||
? Color(int.parse(layoutString))
|
||||
: Colors.redAccent;
|
||||
layoutString != null
|
||||
? Color(int.parse(layoutString))
|
||||
: Colors.redAccent;
|
||||
|
||||
bodyColor =
|
||||
bodyStringColor != null
|
||||
? Color(int.parse(bodyStringColor))
|
||||
: Colors.white;
|
||||
bodyStringColor != null
|
||||
? Color(int.parse(bodyStringColor))
|
||||
: Colors.white;
|
||||
});
|
||||
}
|
||||
|
||||
@ -582,7 +582,6 @@ class _CreateUserFormDetialsState extends State<CreateUserFormDetials> {
|
||||
travelDetailsData = travellerDetailsKey.currentState?.travel_Detials;
|
||||
// errorMessagesTravel = travellerDetailsKey.currentState!.errorMessages;
|
||||
|
||||
|
||||
print("TRAVEL DETAILS FROM CHILD: $travelDetailsData");
|
||||
|
||||
Map<String, dynamic> data = userDetials;
|
||||
@ -657,56 +656,38 @@ class _CreateUserFormDetialsState extends State<CreateUserFormDetials> {
|
||||
// printFormData();
|
||||
|
||||
bool isValid = travellerDetailsKey.currentState?.boolValidation() ?? false;
|
||||
if (selectedTab == "travel" ||
|
||||
selectedRole == "5" ||
|
||||
setSelectesUserType == true) {
|
||||
print("NO validation");
|
||||
|
||||
print("isValid- $isValid");
|
||||
if (!isValid) {
|
||||
print("Validation failed. Please check the inputs.");
|
||||
setState(() {});
|
||||
return; // ❌ STOP execution here if not valid
|
||||
}
|
||||
Map<String, dynamic> data = userDetials;
|
||||
|
||||
if (!isValidData(data)) {
|
||||
print("USERDETAILS : $userDetials");
|
||||
print("Validation Failed: Required fields are missing.");
|
||||
setState(() {});
|
||||
return; // Stop execution if validation fails
|
||||
} else {
|
||||
print("USERDETAILS : $userDetials");
|
||||
orgId = await getOrgId();
|
||||
|
||||
createUserData(userDetials);
|
||||
}
|
||||
} else {
|
||||
print("isValid- $isValid");
|
||||
if (!isValid) {
|
||||
print("Validation failed. Please check the inputs.");
|
||||
setState(() {});
|
||||
return; // ❌ STOP execution here if not valid
|
||||
}
|
||||
|
||||
travelDetailsData = travellerDetailsKey.currentState?.travel_Detials;
|
||||
|
||||
print("travelDetailsData - $travelDetailsData");
|
||||
|
||||
// Additional validation starts - travelDetailsData passport
|
||||
String start_Date = travelDetailsData?['date_of_issue'];
|
||||
String end_Date = travelDetailsData?['date_of_expiry'];
|
||||
|
||||
if (start_Date != null && end_Date != null && start_Date.toString().isNotEmpty && end_Date.toString().isNotEmpty) {
|
||||
try {
|
||||
final format = DateFormat("dd-MM-yyyy");
|
||||
final checkStartDate = format.parse("$start_Date");
|
||||
final checkEndDate = format.parse("$end_Date");
|
||||
|
||||
if (checkEndDate.isBefore(checkStartDate)) {
|
||||
// return "End date cannot be earlier than start date";;
|
||||
return ;
|
||||
}
|
||||
} catch (e) { // return "End date cannot be earlier than start date";
|
||||
return ;
|
||||
// errorMessages["end_date"] = "Invalid date format";
|
||||
}
|
||||
}
|
||||
|
||||
// String valid_from = travelDetailsData?['valid_from'];
|
||||
// String valid_upto = travelDetailsData?['valid_upto'];
|
||||
//
|
||||
// if (valid_from != null && valid_upto != null && valid_from.toString().isNotEmpty && valid_upto.toString().isNotEmpty) {
|
||||
// try {
|
||||
// final format = DateFormat("dd-MM-yyyy");
|
||||
// final checkValidFrom = format.parse("$valid_from");
|
||||
// final checkValidUpto = format.parse("$valid_upto");
|
||||
//
|
||||
// if (checkValidUpto.isBefore(checkValidFrom)) {
|
||||
// // return "End date cannot be earlier than start date";
|
||||
// return ;
|
||||
// }
|
||||
// } catch (e) { // return "End date cannot be earlier than start date";
|
||||
// return ;
|
||||
// // errorMessages["end_date"] = "Invalid date format";
|
||||
// }
|
||||
// }
|
||||
// errorMessagesTravel = travellerDetailsKey.currentState!.errorMessages;
|
||||
print("travelDetailsData - $travelDetailsData");
|
||||
// errorMessagesTravel = travellerDetailsKey.currentState!.errorMessages;
|
||||
|
||||
print("TRAVEL DETAILS FROM CHILD");
|
||||
// print("TRAVEL DETAILS FROM CHILD: $travelDetailsData");
|
||||
@ -731,6 +712,7 @@ class _CreateUserFormDetialsState extends State<CreateUserFormDetials> {
|
||||
orgId = await getOrgId();
|
||||
|
||||
createUserData(userDetials);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -762,7 +744,7 @@ class _CreateUserFormDetialsState extends State<CreateUserFormDetials> {
|
||||
if (data["mobile_no"] != null && data["mobile_no"].toString().isNotEmpty) {
|
||||
if (!RegExp(r"^\d{10}$").hasMatch(data["mobile_no"].toString())) {
|
||||
errorMessages["mobile_no"] =
|
||||
"Enter 10 digits"; // Invalid mobile number format
|
||||
"Enter 10 digits"; // Invalid mobile number format
|
||||
}
|
||||
}
|
||||
|
||||
@ -772,7 +754,7 @@ class _CreateUserFormDetialsState extends State<CreateUserFormDetials> {
|
||||
r"^\d{10}$",
|
||||
).hasMatch(data["alternate_mobile_no"].toString())) {
|
||||
errorMessages["alternate_mobile_no"] =
|
||||
"Enter 10 digits"; // Invalid mobile number format
|
||||
"Enter 10 digits"; // Invalid mobile number format
|
||||
}
|
||||
}
|
||||
|
||||
@ -962,7 +944,7 @@ class _CreateUserFormDetialsState extends State<CreateUserFormDetials> {
|
||||
// ✅ Ensure UI updates
|
||||
if (isMatch) {
|
||||
errorMessages["password"] =
|
||||
"New password is not similar to old password";
|
||||
"New password is not similar to old password";
|
||||
print(" Password match!");
|
||||
} else {
|
||||
print(" Password NOT match!");
|
||||
@ -991,16 +973,16 @@ class _CreateUserFormDetialsState extends State<CreateUserFormDetials> {
|
||||
drawer: CustomDrawer(isDesktop: false),
|
||||
body: Padding(
|
||||
padding:
|
||||
isDesktop
|
||||
? EdgeInsets.symmetric(
|
||||
horizontal:
|
||||
MediaQuery.of(context).size.width *
|
||||
0.1, // 30% of screen width as horizontal padding
|
||||
vertical:
|
||||
MediaQuery.of(context).size.height *
|
||||
0, // 5% of screen height as vertical padding
|
||||
)
|
||||
: EdgeInsets.all(0),
|
||||
isDesktop
|
||||
? EdgeInsets.symmetric(
|
||||
horizontal:
|
||||
MediaQuery.of(context).size.width *
|
||||
0.1, // 30% of screen width as horizontal padding
|
||||
vertical:
|
||||
MediaQuery.of(context).size.height *
|
||||
0, // 5% of screen height as vertical padding
|
||||
)
|
||||
: EdgeInsets.all(0),
|
||||
child: Row(
|
||||
children: [Expanded(child: buildData(isDesktop, context))],
|
||||
),
|
||||
@ -1022,9 +1004,9 @@ class _CreateUserFormDetialsState extends State<CreateUserFormDetials> {
|
||||
Expanded(
|
||||
child: Container(
|
||||
height:
|
||||
isDesktop
|
||||
? MediaQuery.of(context).size.height * 0.98
|
||||
: MediaQuery.of(context).size.height,
|
||||
isDesktop
|
||||
? MediaQuery.of(context).size.height * 0.98
|
||||
: MediaQuery.of(context).size.height,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(0.0),
|
||||
child: _buildUserDetails(isDesktop),
|
||||
@ -1036,39 +1018,39 @@ class _CreateUserFormDetialsState extends State<CreateUserFormDetials> {
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child:
|
||||
isDesktop
|
||||
? Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
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,
|
||||
children:
|
||||
(selectedTab == "travel" ||
|
||||
selectedRole == "5" ||
|
||||
setSelectesUserType == true)
|
||||
? _buildSubmit(isDesktop, layoutColor!)
|
||||
: _buildNext(isDesktop, layoutColor!),
|
||||
),
|
||||
isDesktop
|
||||
? Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
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,
|
||||
children:
|
||||
(selectedTab == "travel" ||
|
||||
selectedRole == "5" ||
|
||||
setSelectesUserType == true)
|
||||
? _buildSubmit(isDesktop, layoutColor!)
|
||||
: _buildNext(isDesktop, layoutColor!),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -1113,9 +1095,9 @@ class _CreateUserFormDetialsState extends State<CreateUserFormDetials> {
|
||||
isDesktop
|
||||
? buildTabsForUser()
|
||||
: SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: buildTabsForUser(),
|
||||
),
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: buildTabsForUser(),
|
||||
),
|
||||
Container(
|
||||
// color: Colors.yellow.shade50,
|
||||
height: MediaQuery.of(context).size.height * 0.64,
|
||||
@ -1218,8 +1200,8 @@ class _CreateUserFormDetialsState extends State<CreateUserFormDetials> {
|
||||
);
|
||||
case "travel":
|
||||
final fullName =
|
||||
"${controllers["Fname"]?.text ?? ""} ${controllers["Lname"]?.text ?? ""}"
|
||||
.trim();
|
||||
"${controllers["Fname"]?.text ?? ""} ${controllers["Lname"]?.text ?? ""}"
|
||||
.trim();
|
||||
return TravellerDetails(
|
||||
key: travellerDetailsKey,
|
||||
isDesktop: isDesktop,
|
||||
@ -1278,69 +1260,69 @@ class _CreateUserFormDetialsState extends State<CreateUserFormDetials> {
|
||||
return Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end, // important
|
||||
children:
|
||||
tabs.entries.map((entry) {
|
||||
final targetTab = entry.key;
|
||||
tabs.entries.map((entry) {
|
||||
final targetTab = entry.key;
|
||||
|
||||
print("TargetsTAb: $targetTab");
|
||||
print("TargetsTAb: $targetTab");
|
||||
|
||||
final isSelected = selectedTab == entry.key;
|
||||
print("isSelected: $isSelected");
|
||||
final isSelected = selectedTab == entry.key;
|
||||
print("isSelected: $isSelected");
|
||||
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
bool isValid = false;
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
bool isValid = false;
|
||||
|
||||
final currentTab = selectedTab;
|
||||
if (currentTab == "personal") {
|
||||
isValid = isValidData(userDetials);
|
||||
final currentTab = selectedTab;
|
||||
if (currentTab == "personal") {
|
||||
isValid = isValidData(userDetials);
|
||||
|
||||
if (isValid) {
|
||||
selectedTab = entry.key;
|
||||
}
|
||||
} else if (currentTab == "office" &&
|
||||
targetTab == "personal") {
|
||||
selectedTab = entry.key;
|
||||
} else if (currentTab == "office") {
|
||||
isValid = isValidDataTwo(userDetials);
|
||||
if (isValid) {
|
||||
selectedTab = entry.key;
|
||||
}
|
||||
} else {
|
||||
isValid =
|
||||
true; // Travel tab might not need validation at this point
|
||||
selectedTab = entry.key;
|
||||
}
|
||||
});
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
right: 24.0,
|
||||
), // space between tabs
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
entry.value,
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w600,
|
||||
color:
|
||||
isSelected ? Color(0xFF114D8B) : Color(0xFF475569),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
AnimatedContainer(
|
||||
duration: Duration(milliseconds: 300),
|
||||
height: 2,
|
||||
width: isSelected ? 50 : 0, // small line
|
||||
color: Color(0xFF114D8B),
|
||||
),
|
||||
],
|
||||
if (isValid) {
|
||||
selectedTab = entry.key;
|
||||
}
|
||||
} else if (currentTab == "office" &&
|
||||
targetTab == "personal") {
|
||||
selectedTab = entry.key;
|
||||
} else if (currentTab == "office") {
|
||||
isValid = isValidDataTwo(userDetials);
|
||||
if (isValid) {
|
||||
selectedTab = entry.key;
|
||||
}
|
||||
} else {
|
||||
isValid =
|
||||
true; // Travel tab might not need validation at this point
|
||||
selectedTab = entry.key;
|
||||
}
|
||||
});
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
right: 24.0,
|
||||
), // space between tabs
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
entry.value,
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w600,
|
||||
color:
|
||||
isSelected ? Color(0xFF114D8B) : Color(0xFF475569),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
const SizedBox(height: 8),
|
||||
AnimatedContainer(
|
||||
duration: Duration(milliseconds: 300),
|
||||
height: 2,
|
||||
width: isSelected ? 50 : 0, // small line
|
||||
color: Color(0xFF114D8B),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
);
|
||||
}
|
||||
|
||||
@ -1350,17 +1332,17 @@ class _CreateUserFormDetialsState extends State<CreateUserFormDetials> {
|
||||
return [
|
||||
MouseRegion(
|
||||
cursor:
|
||||
isViewMode
|
||||
? SystemMouseCursors.forbidden
|
||||
: SystemMouseCursors.click,
|
||||
isViewMode
|
||||
? SystemMouseCursors.forbidden
|
||||
: SystemMouseCursors.click,
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor:
|
||||
isViewMode ? layoutColor : layoutColor, // Keep original color
|
||||
isViewMode ? layoutColor : layoutColor, // Keep original color
|
||||
foregroundColor:
|
||||
isViewMode ? Colors.white : Colors.white, // Keep original color
|
||||
isViewMode ? Colors.white : Colors.white, // Keep original color
|
||||
disabledBackgroundColor:
|
||||
layoutColor, // Ensure color remains when disabled
|
||||
layoutColor, // Ensure color remains when disabled
|
||||
disabledForegroundColor: Colors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
@ -1379,17 +1361,17 @@ class _CreateUserFormDetialsState extends State<CreateUserFormDetials> {
|
||||
return [
|
||||
MouseRegion(
|
||||
cursor:
|
||||
isViewMode
|
||||
? SystemMouseCursors.forbidden
|
||||
: SystemMouseCursors.click,
|
||||
isViewMode
|
||||
? SystemMouseCursors.forbidden
|
||||
: SystemMouseCursors.click,
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor:
|
||||
isViewMode ? layoutColor : layoutColor, // Keep original color
|
||||
isViewMode ? layoutColor : layoutColor, // Keep original color
|
||||
foregroundColor:
|
||||
isViewMode ? Colors.white : Colors.white, // Keep original color
|
||||
isViewMode ? Colors.white : Colors.white, // Keep original color
|
||||
disabledBackgroundColor:
|
||||
layoutColor, // Ensure color remains when disabled
|
||||
layoutColor, // Ensure color remains when disabled
|
||||
disabledForegroundColor: Colors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
@ -1410,17 +1392,17 @@ class _CreateUserFormDetialsState extends State<CreateUserFormDetials> {
|
||||
return [
|
||||
MouseRegion(
|
||||
cursor:
|
||||
isViewMode
|
||||
? SystemMouseCursors.forbidden
|
||||
: SystemMouseCursors.click,
|
||||
isViewMode
|
||||
? SystemMouseCursors.forbidden
|
||||
: SystemMouseCursors.click,
|
||||
child: TextButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor:
|
||||
isViewMode ? Colors.white : Colors.white, // Keep original color
|
||||
isViewMode ? Colors.white : Colors.white, // Keep original color
|
||||
foregroundColor:
|
||||
isViewMode ? layoutColor : layoutColor, // Keep original color
|
||||
isViewMode ? layoutColor : layoutColor, // Keep original color
|
||||
disabledBackgroundColor:
|
||||
layoutColor, // Ensure color remains when disabled
|
||||
layoutColor, // Ensure color remains when disabled
|
||||
disabledForegroundColor: Colors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
@ -1458,19 +1440,19 @@ class _CreateUserFormDetialsState extends State<CreateUserFormDetials> {
|
||||
if (!isViewMode)
|
||||
MouseRegion(
|
||||
cursor:
|
||||
isViewMode
|
||||
? SystemMouseCursors.forbidden
|
||||
: SystemMouseCursors.click,
|
||||
isViewMode
|
||||
? SystemMouseCursors.forbidden
|
||||
: SystemMouseCursors.click,
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor:
|
||||
isViewMode ? layoutColor : layoutColor, // Keep original color
|
||||
isViewMode ? layoutColor : layoutColor, // Keep original color
|
||||
foregroundColor:
|
||||
isViewMode
|
||||
? Colors.white
|
||||
: Colors.white, // Keep original color
|
||||
isViewMode
|
||||
? Colors.white
|
||||
: Colors.white, // Keep original color
|
||||
disabledBackgroundColor:
|
||||
layoutColor, // Ensure color remains when disabled
|
||||
layoutColor, // Ensure color remains when disabled
|
||||
disabledForegroundColor: Colors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
@ -1479,7 +1461,7 @@ class _CreateUserFormDetialsState extends State<CreateUserFormDetials> {
|
||||
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 12),
|
||||
),
|
||||
onPressed:
|
||||
isViewMode ? null : handleSubmit, // Disable when in view mode
|
||||
isViewMode ? null : handleSubmit, // Disable when in view mode
|
||||
child: Text("Submit"),
|
||||
),
|
||||
),
|
||||
|
||||
@ -2,7 +2,7 @@ import 'dart:convert';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
// import 'package:flutter/rendering.dart';
|
||||
import 'dart:html' as html;
|
||||
import 'package:frontend/config/apiUrl.dart'; // 1 newly added
|
||||
import 'package:frontend/services/apiService.dart';
|
||||
@ -31,7 +31,7 @@ class _MyAppState extends State<MyApp> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
SemanticsBinding.instance.ensureSemantics(); // ✅ Safe here
|
||||
// SemanticsBinding.instance.ensureSemantics(); // ✅ Safe here
|
||||
if (kIsWeb) {
|
||||
final uri = Uri.parse(html.window.location.href);
|
||||
if (uri.path == '/authredirection' &&
|
||||
|
||||
Loading…
Reference in New Issue
Block a user