UI_ADDITIONAL_COLOR, UI_ALLTRIPS_CARD
This commit is contained in:
parent
bc8968f9c5
commit
66d62ca8f8
@ -503,7 +503,10 @@ class _ListAllPlansState extends State<ListAllPlans> {
|
||||
|
||||
return Container(
|
||||
margin: isDesktop ? EdgeInsets.all(10.0) : null,
|
||||
padding: const EdgeInsets.only(top: 15, bottom: 15, left: 20, right: 20),
|
||||
padding:
|
||||
isDesktop
|
||||
? const EdgeInsets.only(top: 15, bottom: 15, left: 20, right: 20)
|
||||
: EdgeInsets.all(3.0),
|
||||
height:
|
||||
isDesktop
|
||||
? MediaQuery.of(context).size.height * 0.98
|
||||
@ -1177,13 +1180,36 @@ class _ListAllPlansState extends State<ListAllPlans> {
|
||||
// shadowColor: Colors.black54, // Softer shadow
|
||||
// clipBehavior: Clip.antiAlias,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
// padding: EdgeInsets.symmetric(vertical: 12),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
// color: Colors.red.shade50,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
plan.tripType == 'Domestic'
|
||||
? 'assets/images/IconsImg/Domestic_new.png'
|
||||
: 'assets/images/IconsImg/International_new.png',
|
||||
// width: 65,
|
||||
height:
|
||||
plan.tripType == 'Domestic'
|
||||
? 37
|
||||
: 40,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Container(
|
||||
// color: Colors.yellow.shade50,
|
||||
child: Column(
|
||||
children: [
|
||||
// Status and Employee Code
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
@ -1192,31 +1218,12 @@ class _ListAllPlansState extends State<ListAllPlans> {
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap:
|
||||
() => _showDetails(plan.planId),
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 8,
|
||||
vertical: 4,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: getStatusColor(
|
||||
plan.statusValue,
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(8),
|
||||
),
|
||||
child: Text(
|
||||
plan.statusValue,
|
||||
Text(
|
||||
'${plan.tripTitle}',
|
||||
style: TextStyle(
|
||||
color: getStatusTextColor(
|
||||
plan.statusValue,
|
||||
),
|
||||
fontSize: 10,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
fontSize: 12,
|
||||
fontFamily: "Inter",
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -1244,12 +1251,15 @@ class _ListAllPlansState extends State<ListAllPlans> {
|
||||
child: Container(
|
||||
padding:
|
||||
EdgeInsets.symmetric(
|
||||
horizontal: 8,
|
||||
vertical: 8,
|
||||
horizontal: 1,
|
||||
vertical: 1,
|
||||
// horizontal: 8,
|
||||
// vertical: 8,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize:
|
||||
MainAxisSize.min,
|
||||
MainAxisSize
|
||||
.min,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment
|
||||
.center,
|
||||
@ -1272,7 +1282,8 @@ class _ListAllPlansState extends State<ListAllPlans> {
|
||||
ApiService.viewPlan(
|
||||
context,
|
||||
plan.planId,
|
||||
isViewMode: true,
|
||||
isViewMode:
|
||||
true,
|
||||
);
|
||||
},
|
||||
),
|
||||
@ -1284,7 +1295,8 @@ class _ListAllPlansState extends State<ListAllPlans> {
|
||||
icon: Image.asset(
|
||||
'assets/images/IconsImg/edit.png',
|
||||
width: 20,
|
||||
height: 15,
|
||||
height:
|
||||
15,
|
||||
),
|
||||
tooltip:
|
||||
'Edit The Trip Details',
|
||||
@ -1319,7 +1331,8 @@ class _ListAllPlansState extends State<ListAllPlans> {
|
||||
),
|
||||
IconButton(
|
||||
icon: Icon(
|
||||
Icons.download,
|
||||
Icons
|
||||
.download,
|
||||
color: Color(
|
||||
0xFF114D8B,
|
||||
),
|
||||
@ -1339,7 +1352,8 @@ class _ListAllPlansState extends State<ListAllPlans> {
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(
|
||||
Icons.comment,
|
||||
Icons
|
||||
.comment,
|
||||
color: Color(
|
||||
0xFF475569,
|
||||
),
|
||||
@ -1349,15 +1363,15 @@ class _ListAllPlansState extends State<ListAllPlans> {
|
||||
'Trip Comments',
|
||||
onPressed: () {
|
||||
showDialog(
|
||||
context: context,
|
||||
context:
|
||||
context,
|
||||
builder:
|
||||
(
|
||||
context,
|
||||
) => CommentModalList(
|
||||
// planId: plan.planId,
|
||||
planId:
|
||||
plan.planId
|
||||
.toString(),
|
||||
plan.planId.toString(),
|
||||
layoutColorForUser:
|
||||
layoutColor!,
|
||||
role:
|
||||
@ -1377,65 +1391,10 @@ class _ListAllPlansState extends State<ListAllPlans> {
|
||||
],
|
||||
),
|
||||
|
||||
SizedBox(height: 2),
|
||||
// Trip Id and Trip Name
|
||||
Row(
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
' ${plan.tripTitle}',
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
fontFamily: "Inter",
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 2),
|
||||
// Type and Created On
|
||||
Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
' ${plan.tripType}',
|
||||
style: TextStyle(
|
||||
fontSize: 9,
|
||||
color: Colors.black87,
|
||||
fontFamily: "Inter",
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'${_formatDate(plan.createdOn)}',
|
||||
style: TextStyle(
|
||||
fontSize: 9,
|
||||
color: Colors.black87,
|
||||
fontFamily: "Inter",
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 3),
|
||||
// Name
|
||||
Row(
|
||||
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
@ -1446,33 +1405,397 @@ class _ListAllPlansState extends State<ListAllPlans> {
|
||||
? '${plan.userName}'
|
||||
: '${plan.travellerName}',
|
||||
style: TextStyle(
|
||||
fontSize: 9,
|
||||
fontSize: 12,
|
||||
fontFamily: "Inter",
|
||||
color: Colors.black87,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Spacer(),
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
plan.employeeCode ?? 'No Data',
|
||||
plan.employeeCode ??
|
||||
'No Data',
|
||||
style: TextStyle(
|
||||
fontSize: 9,
|
||||
fontFamily: "Inter",
|
||||
color: Colors.black87,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'${_formatDate(plan.createdOn)}',
|
||||
style: TextStyle(
|
||||
fontSize: 10,
|
||||
color: Colors.black87,
|
||||
fontFamily: "Inter",
|
||||
),
|
||||
),
|
||||
|
||||
// Column(
|
||||
// crossAxisAlignment:
|
||||
// CrossAxisAlignment.start,
|
||||
// children: [
|
||||
//
|
||||
// ],
|
||||
// ),
|
||||
// Spacer(),
|
||||
// Column(
|
||||
// crossAxisAlignment:
|
||||
// CrossAxisAlignment.start,
|
||||
// children: [
|
||||
//
|
||||
// ],
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap:
|
||||
() => _showDetails(
|
||||
plan.planId,
|
||||
),
|
||||
child: Container(
|
||||
padding:
|
||||
EdgeInsets.symmetric(
|
||||
horizontal: 8,
|
||||
vertical: 4,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: getStatusColor(
|
||||
plan.statusValue,
|
||||
),
|
||||
borderRadius:
|
||||
BorderRadius.circular(
|
||||
8,
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
plan.statusValue,
|
||||
style: TextStyle(
|
||||
color:
|
||||
getStatusTextColor(
|
||||
plan.statusValue,
|
||||
),
|
||||
fontSize: 10,
|
||||
fontWeight:
|
||||
FontWeight.w600,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
// Actions
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
// padding: EdgeInsets.symmetric(vertical: 12),
|
||||
// child: Container(
|
||||
// // color: Colors.yellow,
|
||||
// child: Column(
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// mainAxisAlignment: MainAxisAlignment.start,
|
||||
// children: [
|
||||
// // Status and Employee Code
|
||||
// Row(
|
||||
// mainAxisAlignment:
|
||||
// MainAxisAlignment.spaceBetween,
|
||||
// children: [
|
||||
// Column(
|
||||
// crossAxisAlignment:
|
||||
// CrossAxisAlignment.start,
|
||||
// children: [
|
||||
// GestureDetector(
|
||||
// onTap:
|
||||
// () => _showDetails(plan.planId),
|
||||
// child: Container(
|
||||
// padding: EdgeInsets.symmetric(
|
||||
// horizontal: 8,
|
||||
// vertical: 4,
|
||||
// ),
|
||||
// decoration: BoxDecoration(
|
||||
// color: getStatusColor(
|
||||
// plan.statusValue,
|
||||
// ),
|
||||
// borderRadius:
|
||||
// BorderRadius.circular(8),
|
||||
// ),
|
||||
// child: Text(
|
||||
// plan.statusValue,
|
||||
// style: TextStyle(
|
||||
// color: getStatusTextColor(
|
||||
// plan.statusValue,
|
||||
// ),
|
||||
// fontSize: 10,
|
||||
// fontWeight: FontWeight.w600,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// Column(
|
||||
// children: [
|
||||
// // PlanPopupMenu(
|
||||
// // plan: plan,
|
||||
// // deletePlan: deletePlan,
|
||||
// // apiService: apiService,
|
||||
// // layoutColor: layoutColor,
|
||||
// // ),
|
||||
// PopupMenuButton<int>(
|
||||
// color: Colors.white,
|
||||
// padding: EdgeInsets.zero,
|
||||
// offset: Offset(0, 30),
|
||||
// icon: Icon(
|
||||
// Icons.more_vert,
|
||||
// color: Color(0xFF475569),
|
||||
// size: 14,
|
||||
// ),
|
||||
// itemBuilder:
|
||||
// (context) => [
|
||||
// CustomPopupMenuEntry(
|
||||
// child: Container(
|
||||
// padding:
|
||||
// EdgeInsets.symmetric(
|
||||
// horizontal: 1,
|
||||
// vertical: 1,
|
||||
// // horizontal: 8,
|
||||
// // vertical: 8,
|
||||
// ),
|
||||
// child: Row(
|
||||
// mainAxisSize:
|
||||
// MainAxisSize.min,
|
||||
// mainAxisAlignment:
|
||||
// MainAxisAlignment
|
||||
// .center,
|
||||
// children: [
|
||||
// IconButton(
|
||||
// icon: Icon(
|
||||
// Icons
|
||||
// .remove_red_eye,
|
||||
// color: Color(
|
||||
// 0xFF475569,
|
||||
// ),
|
||||
// size: 18,
|
||||
// ),
|
||||
// tooltip:
|
||||
// 'View The Trip Details',
|
||||
// onPressed: () {
|
||||
// Navigator.pop(
|
||||
// context,
|
||||
// ); // Close popup manually
|
||||
// ApiService.viewPlan(
|
||||
// context,
|
||||
// plan.planId,
|
||||
// isViewMode:
|
||||
// true,
|
||||
// );
|
||||
// },
|
||||
// ),
|
||||
// if (plan.statusValue ==
|
||||
// "Pending Approval" ||
|
||||
// plan.statusValue ==
|
||||
// "Partially Approved")
|
||||
// IconButton(
|
||||
// icon: Image.asset(
|
||||
// 'assets/images/IconsImg/edit.png',
|
||||
// width: 20,
|
||||
// height: 15,
|
||||
// ),
|
||||
// tooltip:
|
||||
// 'Edit The Trip Details',
|
||||
// onPressed: () {
|
||||
// Navigator.pop(
|
||||
// context,
|
||||
// );
|
||||
// ApiService.viewPlan(
|
||||
// context,
|
||||
// plan.planId,
|
||||
// isViewMode:
|
||||
// false,
|
||||
// );
|
||||
// },
|
||||
// ),
|
||||
// IconButton(
|
||||
// icon: Icon(
|
||||
// Icons
|
||||
// .cancel_rounded,
|
||||
// size: 18,
|
||||
// ),
|
||||
// tooltip:
|
||||
// 'Cancellation The Trip Details',
|
||||
// onPressed: () {
|
||||
// Navigator.pop(
|
||||
// context,
|
||||
// );
|
||||
// deletePlan(
|
||||
// plan.planId,
|
||||
// );
|
||||
// },
|
||||
// ),
|
||||
// IconButton(
|
||||
// icon: Icon(
|
||||
// Icons.download,
|
||||
// color: Color(
|
||||
// 0xFF114D8B,
|
||||
// ),
|
||||
// size: 18,
|
||||
// ),
|
||||
// tooltip:
|
||||
// 'Download The PDF',
|
||||
// onPressed: () {
|
||||
// Navigator.pop(
|
||||
// context,
|
||||
// );
|
||||
// apiService
|
||||
// .getPdfDownload(
|
||||
// plan.planId,
|
||||
// );
|
||||
// },
|
||||
// ),
|
||||
// IconButton(
|
||||
// icon: const Icon(
|
||||
// Icons.comment,
|
||||
// color: Color(
|
||||
// 0xFF475569,
|
||||
// ),
|
||||
// size: 11,
|
||||
// ),
|
||||
// tooltip:
|
||||
// 'Trip Comments',
|
||||
// onPressed: () {
|
||||
// showDialog(
|
||||
// context:
|
||||
// context,
|
||||
// builder:
|
||||
// (
|
||||
// context,
|
||||
// ) => CommentModalList(
|
||||
// // planId: plan.planId,
|
||||
// planId:
|
||||
// plan.planId
|
||||
// .toString(),
|
||||
// layoutColorForUser:
|
||||
// layoutColor!,
|
||||
// role:
|
||||
// "Admin",
|
||||
// ),
|
||||
// );
|
||||
// },
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
//
|
||||
// SizedBox(height: 2),
|
||||
// // Trip Id and Trip Name
|
||||
// Row(
|
||||
// children: [
|
||||
// Column(
|
||||
// crossAxisAlignment:
|
||||
// CrossAxisAlignment.start,
|
||||
// children: [
|
||||
// Text(
|
||||
// ' ${plan.tripTitle}',
|
||||
// style: TextStyle(
|
||||
// fontSize: 12,
|
||||
// fontFamily: "Inter",
|
||||
// fontWeight: FontWeight.bold,
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// SizedBox(height: 2),
|
||||
// // Type and Created On
|
||||
// Row(
|
||||
// mainAxisAlignment:
|
||||
// MainAxisAlignment.spaceBetween,
|
||||
// children: [
|
||||
// Column(
|
||||
// crossAxisAlignment:
|
||||
// CrossAxisAlignment.start,
|
||||
// children: [
|
||||
// Text(
|
||||
// ' ${plan.tripType}',
|
||||
// style: TextStyle(
|
||||
// fontSize: 9,
|
||||
// color: Colors.black87,
|
||||
// fontFamily: "Inter",
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// Column(
|
||||
// crossAxisAlignment:
|
||||
// CrossAxisAlignment.start,
|
||||
// children: [
|
||||
// Text(
|
||||
// '${_formatDate(plan.createdOn)}',
|
||||
// style: TextStyle(
|
||||
// fontSize: 9,
|
||||
// color: Colors.black87,
|
||||
// fontFamily: "Inter",
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// SizedBox(height: 3),
|
||||
// // Name
|
||||
// Row(
|
||||
// children: [
|
||||
// Column(
|
||||
// crossAxisAlignment:
|
||||
// CrossAxisAlignment.start,
|
||||
// children: [
|
||||
// Text(
|
||||
// plan.userName.isNotEmpty
|
||||
// ? '${plan.userName}'
|
||||
// : '${plan.travellerName}',
|
||||
// style: TextStyle(
|
||||
// fontSize: 9,
|
||||
// fontFamily: "Inter",
|
||||
// color: Colors.black87,
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// Spacer(),
|
||||
// Column(
|
||||
// crossAxisAlignment:
|
||||
// CrossAxisAlignment.start,
|
||||
// children: [
|
||||
// Text(
|
||||
// plan.employeeCode ?? 'No Data',
|
||||
// style: TextStyle(
|
||||
// fontSize: 9,
|
||||
// fontFamily: "Inter",
|
||||
// color: Colors.black87,
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// // Actions
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
@ -39,6 +39,8 @@ class _OrgSetUpState extends State<OrgSetUp> {
|
||||
List<dynamic>? apiAllServices;
|
||||
Map<String, dynamic>? selectedOrg;
|
||||
Color? layoutColor;
|
||||
Color? layoutSecondaryColor;
|
||||
Color? layoutTertiaryColor;
|
||||
Color? bodyColor;
|
||||
|
||||
bool isSelected = false;
|
||||
@ -112,6 +114,10 @@ class _OrgSetUpState extends State<OrgSetUp> {
|
||||
|
||||
"layout_color":
|
||||
"0x${layoutColor?.toARGB32().toRadixString(16).padLeft(8, '0').toUpperCase()}",
|
||||
"secondary_color":
|
||||
"0x${layoutSecondaryColor?.toARGB32().toRadixString(16).padLeft(8, '0').toUpperCase()}",
|
||||
"tertiary_color":
|
||||
"0x${layoutTertiaryColor?.toARGB32().toRadixString(16).padLeft(8, '0').toUpperCase()}",
|
||||
"color":
|
||||
"0x${bodyColor?.toARGB32().toRadixString(16).padLeft(8, '0').toUpperCase()}",
|
||||
|
||||
@ -181,6 +187,7 @@ class _OrgSetUpState extends State<OrgSetUp> {
|
||||
// }
|
||||
|
||||
String? rawLogoPath = selectedOrg?['logo'];
|
||||
|
||||
if (rawLogoPath != null && rawLogoPath.contains('/assets')) {
|
||||
const baseUrl = apiUrl;
|
||||
// const baseUrl = "https://apitest.tripapprovaltool.com";
|
||||
@ -202,6 +209,30 @@ class _OrgSetUpState extends State<OrgSetUp> {
|
||||
),
|
||||
)
|
||||
: Colors.white;
|
||||
layoutSecondaryColor =
|
||||
selectedOrg?['secondary_color'] != null
|
||||
? Color(
|
||||
int.parse(
|
||||
selectedOrg!['secondary_color'].toString().replaceFirst(
|
||||
'0x',
|
||||
'',
|
||||
),
|
||||
radix: 16,
|
||||
),
|
||||
)
|
||||
: Colors.white;
|
||||
layoutTertiaryColor =
|
||||
selectedOrg?['tertiary_color'] != null
|
||||
? Color(
|
||||
int.parse(
|
||||
selectedOrg!['tertiary_color'].toString().replaceFirst(
|
||||
'0x',
|
||||
'',
|
||||
),
|
||||
radix: 16,
|
||||
),
|
||||
)
|
||||
: Colors.white;
|
||||
|
||||
bodyColor =
|
||||
selectedOrg?['color'] != null
|
||||
@ -760,24 +791,34 @@ class _OrgSetUpState extends State<OrgSetUp> {
|
||||
// color: Color(0xFFF5F5F5),
|
||||
color: Colors.white,
|
||||
),
|
||||
padding: EdgeInsets.only(left: 5, right: 5, top: 15, bottom: 5),
|
||||
padding: EdgeInsets.only(
|
||||
left: 5,
|
||||
right: 5,
|
||||
top: 15,
|
||||
bottom: 5,
|
||||
),
|
||||
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.vertical,
|
||||
child: isDesktop
|
||||
child:
|
||||
isDesktop
|
||||
? Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.spaceEvenly,
|
||||
children: _buildOptions(),
|
||||
)
|
||||
: SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: ConstrainedBox( // ✅ Prevent overflow by setting min width
|
||||
child: ConstrainedBox(
|
||||
// ✅ Prevent overflow by setting min width
|
||||
constraints: BoxConstraints(
|
||||
minWidth: MediaQuery.of(context).size.width,
|
||||
),
|
||||
child: IntrinsicWidth( // ✅ Let Row size itself correctly
|
||||
child: IntrinsicWidth(
|
||||
// ✅ Let Row size itself correctly
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: _buildOptions(),
|
||||
),
|
||||
),
|
||||
@ -817,9 +858,15 @@ class _OrgSetUpState extends State<OrgSetUp> {
|
||||
initialBodyColor: bodyColor,
|
||||
onLayoutColorSelected: (
|
||||
Color selectedLayoutColor,
|
||||
Color selectedSecondaryColor,
|
||||
Color selectedTeritaryColor,
|
||||
) {
|
||||
setState(() {
|
||||
layoutColor = selectedLayoutColor;
|
||||
layoutSecondaryColor =
|
||||
selectedSecondaryColor;
|
||||
layoutTertiaryColor =
|
||||
selectedTeritaryColor;
|
||||
});
|
||||
},
|
||||
onBodyColorSelected: (
|
||||
|
||||
@ -4,7 +4,8 @@ class ColorThemePickerWidget extends StatefulWidget {
|
||||
final Color? initialLayoutColor;
|
||||
final Color? initialBodyColor;
|
||||
|
||||
final Function(Color) onLayoutColorSelected;
|
||||
final Function(Color layout, Color secondaryColor, Color tertiaryColor)
|
||||
onLayoutColorSelected;
|
||||
final Function(Color) onBodyColorSelected;
|
||||
|
||||
const ColorThemePickerWidget({
|
||||
@ -21,6 +22,8 @@ class ColorThemePickerWidget extends StatefulWidget {
|
||||
|
||||
class _ColorThemePickerWidgetState extends State<ColorThemePickerWidget> {
|
||||
late Color selectedLayoutColor;
|
||||
Color? selectedSecondaryColor;
|
||||
Color? selectedTertiaryColor;
|
||||
late Color selectedBodyColor;
|
||||
|
||||
// Layout colors
|
||||
@ -38,6 +41,34 @@ class _ColorThemePickerWidgetState extends State<ColorThemePickerWidget> {
|
||||
Color(0xFF9B59B6), // Purple 2
|
||||
];
|
||||
|
||||
final List<Color> layoutSecondaryColors = [
|
||||
Color(0xFF00B0FF), // Lighter Blue
|
||||
Color(0xFF00ACC1), // Teal Blue
|
||||
Color(0xFF43A047), // Dark Green
|
||||
Color(0xFF27AE60), // Medium Emerald
|
||||
Color(0xFFFFC107), // Amber (complementary to orange)
|
||||
Color(0xFFFFA726), // Light orange
|
||||
Color(0xFFE64A19), // Deep Orange
|
||||
Color(0xFFFF4081), // Bright Pink (complementary to rose)
|
||||
Color(0xFFF48FB1), // Light Pink
|
||||
Color(0xFFBA68C8), // Light Purple
|
||||
Color(0xFFAB47BC), // Orchid Purple
|
||||
];
|
||||
|
||||
final List<Color> layoutTertiaryColors = [
|
||||
Color(0xFF82B1FF), // Very Light Blue
|
||||
Color(0xFF4DD0E1), // Lighter Teal
|
||||
Color(0xFF81C784), // Light Green
|
||||
Color(0xFFAAF0D1), // Pastel Mint
|
||||
Color(0xFFFFE0B2), // Pale Orange
|
||||
Color(0xFFFFCCBC), // Light Orange Peach
|
||||
Color(0xFFFFAB91), // Light Coral
|
||||
Color(0xFFF8BBD0), // Pastel Rose
|
||||
Color(0xFFF8BBD0), // Pastel Pink
|
||||
Color(0xFFE1BEE7), // Lavender
|
||||
Color(0xFFD1C4E9), // Light Purple Grey
|
||||
];
|
||||
|
||||
// Body colors
|
||||
final List<Color> bodyThemeColors = [
|
||||
Color(0xFFD9EAFF),
|
||||
@ -63,14 +94,34 @@ class _ColorThemePickerWidgetState extends State<ColorThemePickerWidget> {
|
||||
children: [
|
||||
// Layout Color Picker
|
||||
GestureDetector(
|
||||
onTap: () => _showColorPickerDialog(
|
||||
onTap:
|
||||
() => _showColorPickerDialog(
|
||||
title: "Choose Layout Color",
|
||||
colors: layoutThemeColors,
|
||||
onColorSelected: (color) {
|
||||
setState(() {
|
||||
selectedLayoutColor = color;
|
||||
print("selectedLayoutColor - $selectedLayoutColor");
|
||||
final SelectedIndex = layoutThemeColors.indexOf(color);
|
||||
print("SelectedIndexLayout - $SelectedIndex");
|
||||
|
||||
if (SelectedIndex != -1) {
|
||||
final secondaryColor =
|
||||
layoutSecondaryColors[SelectedIndex];
|
||||
final primaryColor = layoutTertiaryColors[SelectedIndex];
|
||||
|
||||
selectedSecondaryColor = secondaryColor;
|
||||
selectedTertiaryColor = primaryColor;
|
||||
|
||||
print("selectedSecondaryColor - $selectedSecondaryColor");
|
||||
print("selectedPrimaryColor - $selectedTertiaryColor");
|
||||
}
|
||||
});
|
||||
widget.onLayoutColorSelected(color);
|
||||
widget.onLayoutColorSelected(
|
||||
color,
|
||||
selectedSecondaryColor!,
|
||||
selectedTertiaryColor!,
|
||||
);
|
||||
},
|
||||
),
|
||||
child: _buildColorBox(
|
||||
@ -179,20 +230,33 @@ class _ColorThemePickerWidgetState extends State<ColorThemePickerWidget> {
|
||||
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
builder:
|
||||
(context) => AlertDialog(
|
||||
title: Text(title),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: firstRow.map((color) => _buildColorCircle(color, onColorSelected)).toList(),
|
||||
children:
|
||||
firstRow
|
||||
.map(
|
||||
(color) =>
|
||||
_buildColorCircle(color, onColorSelected),
|
||||
)
|
||||
.toList(),
|
||||
),
|
||||
if (secondRow.isNotEmpty) SizedBox(height: 10),
|
||||
if (secondRow.isNotEmpty)
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: secondRow.map((color) => _buildColorCircle(color, onColorSelected)).toList(),
|
||||
children:
|
||||
secondRow
|
||||
.map(
|
||||
(color) =>
|
||||
_buildColorCircle(color, onColorSelected),
|
||||
)
|
||||
.toList(),
|
||||
),
|
||||
],
|
||||
),
|
||||
@ -215,5 +279,4 @@ class _ColorThemePickerWidgetState extends State<ColorThemePickerWidget> {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -103,7 +103,6 @@ class PersonalDetailsState extends State<PersonalDetails> {
|
||||
bool _postalCodeFocus = false;
|
||||
bool _roleIdFocus = false;
|
||||
|
||||
|
||||
late bool isTravelAgent = false;
|
||||
|
||||
String? selectedTab;
|
||||
@ -158,7 +157,7 @@ class PersonalDetailsState extends State<PersonalDetails> {
|
||||
Color? bodyColor;
|
||||
|
||||
final Map<String, TextEditingController> controllers = {};
|
||||
Map<String, String> errorMessages2 = {};
|
||||
Map<String, String> errorMessages = {};
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@ -180,21 +179,28 @@ class PersonalDetailsState extends State<PersonalDetails> {
|
||||
|
||||
print("selectedServiceIdsAPI - $selectedServiceIds");
|
||||
|
||||
|
||||
_addFocusListener(_fnameFocusNode, (focus) => _fnameFocus = focus);
|
||||
_addFocusListener(_lnameFocusNode, (focus) => _lnameFocus = focus);
|
||||
_addFocusListener(_emailFocusNode, (focus) => _emailFocus = focus);
|
||||
_addFocusListener(_passwordFocusNode, (focus) => _passwordFocus = focus);
|
||||
_addFocusListener(_dobFocusNode, (focus) => _dobFocus = focus);
|
||||
_addFocusListener(_genderFocusNode, (focus) => _genderFocus = focus);
|
||||
_addFocusListener(_mobileNumberFocusNode, (focus) => _mobileNumberFocus = focus);
|
||||
_addFocusListener(_alternateMobileFocusNode, (focus) => _alternateMobileFocus = focus);
|
||||
_addFocusListener(
|
||||
_mobileNumberFocusNode,
|
||||
(focus) => _mobileNumberFocus = focus,
|
||||
);
|
||||
_addFocusListener(
|
||||
_alternateMobileFocusNode,
|
||||
(focus) => _alternateMobileFocus = focus,
|
||||
);
|
||||
_addFocusListener(_addressFocusNode, (focus) => _addressFocus = focus);
|
||||
_addFocusListener(_countryFocusNode, (focus) => _countryFocus = focus);
|
||||
_addFocusListener(_postalCodeFocusNode, (focus) => _postalCodeFocus = focus);
|
||||
_addFocusListener(
|
||||
_postalCodeFocusNode,
|
||||
(focus) => _postalCodeFocus = focus,
|
||||
);
|
||||
_addFocusListener(_roleIdFocusNode, (focus) => _roleIdFocus = focus);
|
||||
|
||||
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
loadAllServices();
|
||||
getOrganizationData();
|
||||
@ -233,7 +239,7 @@ class PersonalDetailsState extends State<PersonalDetails> {
|
||||
userId,
|
||||
);
|
||||
if (response.isNotEmpty) {
|
||||
_clearError(field);
|
||||
// _clearError(field);
|
||||
widget.errorMessages[field] =
|
||||
response['message'] ?? "$label Already Exists";
|
||||
print("Duplicate found: ${response['message']}");
|
||||
@ -1100,7 +1106,9 @@ class PersonalDetailsState extends State<PersonalDetails> {
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color : (layoutColor ?? Colors.grey), width: 0.5),
|
||||
color: (layoutColor ?? Colors.grey),
|
||||
width: 0.5,
|
||||
),
|
||||
),
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
horizontal: 10,
|
||||
@ -1130,7 +1138,9 @@ class PersonalDetailsState extends State<PersonalDetails> {
|
||||
});
|
||||
widget.onGenderChanged?.call(newValue);
|
||||
},
|
||||
),),),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -1187,8 +1197,7 @@ class PersonalDetailsState extends State<PersonalDetails> {
|
||||
isDesktop: widget.isDesktop,
|
||||
child: SizedBox(
|
||||
height: 40,
|
||||
child:
|
||||
Focus(
|
||||
child: Focus(
|
||||
focusNode: _dobFocusNode,
|
||||
onKeyEvent: (FocusNode node, KeyEvent event) {
|
||||
// Only act on KeyDown and when Enter is pressed
|
||||
@ -1225,7 +1234,10 @@ class PersonalDetailsState extends State<PersonalDetails> {
|
||||
child: TextField(
|
||||
controller: widget.controllers["dob"],
|
||||
readOnly: true,
|
||||
style: GoogleFonts.poppins(fontSize: 12, color: Colors.black),
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: 12,
|
||||
color: Colors.black,
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
labelText: "Select Date",
|
||||
labelStyle: GoogleFonts.poppins(
|
||||
@ -1538,7 +1550,10 @@ class PersonalDetailsState extends State<PersonalDetails> {
|
||||
searchFieldProps: TextFieldProps(
|
||||
decoration: InputDecoration(
|
||||
hintText: "Search Country...",
|
||||
contentPadding: EdgeInsets.symmetric(horizontal: 3,vertical: 3),
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
horizontal: 3,
|
||||
vertical: 3,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@ -1569,9 +1584,14 @@ class PersonalDetailsState extends State<PersonalDetails> {
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color : (layoutColor ?? Colors.grey), width: 0.5),
|
||||
color: (layoutColor ?? Colors.grey),
|
||||
width: 0.5,
|
||||
),
|
||||
),
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
horizontal: 10.0,
|
||||
vertical: 8.0,
|
||||
),
|
||||
contentPadding: EdgeInsets.symmetric(horizontal: 10.0, vertical: 8.0),
|
||||
),
|
||||
),
|
||||
dropdownBuilder:
|
||||
@ -1610,7 +1630,9 @@ class PersonalDetailsState extends State<PersonalDetails> {
|
||||
|
||||
final countryCode =
|
||||
countryMap.entries
|
||||
.firstWhere((entry) => entry.value == newValue)
|
||||
.firstWhere(
|
||||
(entry) => entry.value == newValue,
|
||||
)
|
||||
.key;
|
||||
|
||||
setState(() {
|
||||
@ -1621,7 +1643,9 @@ class PersonalDetailsState extends State<PersonalDetails> {
|
||||
countryCode,
|
||||
); // ✅ send code not name
|
||||
},
|
||||
),),)
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -1781,7 +1805,8 @@ class PersonalDetailsState extends State<PersonalDetails> {
|
||||
_roleIdFocusNode?.requestFocus();
|
||||
},
|
||||
child: DropdownSearch<String>(
|
||||
selectedItem: selectedRole != null ? roleMap[selectedRole] : null,
|
||||
selectedItem:
|
||||
selectedRole != null ? roleMap[selectedRole] : null,
|
||||
enabled: !widget.isViewMode,
|
||||
popupProps: PopupProps.menu(
|
||||
showSearchBox: true,
|
||||
@ -1834,7 +1859,10 @@ class PersonalDetailsState extends State<PersonalDetails> {
|
||||
),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color : (layoutColor ?? Colors.grey), width: 0.5),
|
||||
borderSide: BorderSide(
|
||||
color: (layoutColor ?? Colors.grey),
|
||||
width: 0.5,
|
||||
),
|
||||
),
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
horizontal: 8,
|
||||
@ -1861,7 +1889,9 @@ class PersonalDetailsState extends State<PersonalDetails> {
|
||||
if (newValue == null) return;
|
||||
final selectedKey =
|
||||
roleMap.entries
|
||||
.firstWhere((entry) => entry.value == newValue)
|
||||
.firstWhere(
|
||||
(entry) => entry.value == newValue,
|
||||
)
|
||||
.key;
|
||||
|
||||
setState(() {
|
||||
@ -1872,7 +1902,9 @@ class PersonalDetailsState extends State<PersonalDetails> {
|
||||
widget.onUserTypeChanged?.call(isTravelAgent);
|
||||
widget.onRoleChanged?.call(selectedKey);
|
||||
},
|
||||
),),),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
if (widget.errorMessages["role_id"] != null) ...[
|
||||
|
||||
Loading…
Reference in New Issue
Block a user