ui changes group,policy
This commit is contained in:
parent
ceb6aece50
commit
d59aaf90bc
@ -199,13 +199,38 @@ class _ApprovalListState extends State<ApprovalList> {
|
||||
// }
|
||||
// }
|
||||
|
||||
Future<Map<String, dynamic>> getViewPlan(String planId) async {
|
||||
final String apiUrldata = '$apiUrl/api/plans/find/$planId';
|
||||
print("API URL: $apiUrldata");
|
||||
// final token = await getToken();
|
||||
|
||||
if (token == null) {
|
||||
throw Exception('Token not found. Please log in.');
|
||||
}
|
||||
|
||||
final response = await http.put(
|
||||
Uri.parse(apiUrldata),
|
||||
headers: {
|
||||
'Authorization': 'Bearer $token', // Add token here
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
final Map<String, dynamic>? resData = json.decode(response.body);
|
||||
|
||||
return resData?["data"];
|
||||
} else {
|
||||
throw Exception('Failed to load plans');
|
||||
}
|
||||
}
|
||||
|
||||
void viewPlanforApprover(String planId,
|
||||
{bool isViewMode = false, bool isApprover = true}) async {
|
||||
try {
|
||||
Map<String, dynamic> planData =
|
||||
await apiService.getViewPlan(planId, plansJson);
|
||||
print("ViewAAA - $planData");
|
||||
Map<String, dynamic> planData = await getViewPlan(planId);
|
||||
|
||||
print("ViewAAA - $planData");
|
||||
context.go('/createPlan', extra: {
|
||||
'planData': planData,
|
||||
'isViewMode': isViewMode,
|
||||
@ -216,6 +241,18 @@ class _ApprovalListState extends State<ApprovalList> {
|
||||
}
|
||||
}
|
||||
|
||||
// void viewPlan(String planId, {bool isViewMode = false}) async {
|
||||
// try {
|
||||
// Map<String, dynamic> planData = await getViewPlan(planId);
|
||||
// print("ViewAAA - $planData");
|
||||
//
|
||||
// context.go('/createPlan',
|
||||
// extra: {'planData': planData, 'isViewMode': isViewMode});
|
||||
// } catch (e) {
|
||||
// print("Error fetching plan: $e");
|
||||
// }
|
||||
// }
|
||||
|
||||
Widget build(BuildContext context) {
|
||||
return ResponsiveBuilder(builder: (context, sizingInfo) {
|
||||
bool isDesktop = sizingInfo.deviceScreenType == DeviceScreenType.desktop;
|
||||
@ -227,18 +264,46 @@ class _ApprovalListState extends State<ApprovalList> {
|
||||
body: Row(
|
||||
children: [
|
||||
if (isDesktop) CustomDrawer(isDesktop: true),
|
||||
Expanded(child: buildTableLayout(isDesktop))
|
||||
Expanded(child: buildGroupListLayout(isDesktop))
|
||||
],
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Widget buildGroupListLayout(bool isDesktop) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
// color: Colors.amber,
|
||||
color: bodyColor,
|
||||
border: Border.all(color: Color(0xFFF7F7FB), width: 3.5)),
|
||||
child: buildTableLayout(isDesktop),
|
||||
);
|
||||
}
|
||||
|
||||
Widget buildTableLayout(isDesktop) {
|
||||
return Container(
|
||||
color: bodyColor,
|
||||
margin: isDesktop
|
||||
? EdgeInsets.all(10.0)
|
||||
: EdgeInsets.only(left: 20.0, bottom: 20.0, top: 10.0, right: 20.0),
|
||||
padding: const EdgeInsets.all(10),
|
||||
height: isDesktop
|
||||
? MediaQuery.of(context).size.height * 0.98
|
||||
: MediaQuery.of(context).size.height,
|
||||
decoration: BoxDecoration(
|
||||
border: isDesktop
|
||||
? Border.all(
|
||||
width: 2,
|
||||
color: Color(0xFFF7F7FB),
|
||||
)
|
||||
: null,
|
||||
color: Colors.white,
|
||||
// color: Color(0xFFF7F7FB),
|
||||
|
||||
// color: Colors.amber,
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
padding: const EdgeInsets.all(1.0),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
color: Colors.white,
|
||||
|
||||
@ -193,22 +193,30 @@ class _groupState extends State<Group> {
|
||||
}
|
||||
|
||||
Future<void> postGroupData(Map<String, dynamic> groupData) async {
|
||||
// final String apiUrldata = '$apiUrl/api/groups/create';
|
||||
|
||||
final token = await getToken(); // Fetch token
|
||||
|
||||
final bool isEdit = widget.group != null && widget.group!.isNotEmpty;
|
||||
print("isEdit: $isEdit");
|
||||
print("postGroupData- ${widget.group?['group_id']}");
|
||||
|
||||
// Determine whether it's create or update
|
||||
final bool isEdit = widget.group != null && widget.group!.isNotEmpty;
|
||||
final int? groupId = int.tryParse(selectedGroupId!);
|
||||
String apiUrlData;
|
||||
|
||||
print("postGroupData1 - $selectedGroupId");
|
||||
if (isEdit) {
|
||||
if (selectedGroupId == null) {
|
||||
print("selectedGroupId is null. Cannot proceed.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Build correct API URL
|
||||
final String apiUrlData = isEdit
|
||||
? '$apiUrl/api/groups/update/$groupId' // Update API
|
||||
: '$apiUrl/api/groups/create';
|
||||
final int? groupId = int.tryParse(selectedGroupId!);
|
||||
if (groupId == null) {
|
||||
print("groupId is invalid. selectedGroupId = $selectedGroupId");
|
||||
return;
|
||||
}
|
||||
|
||||
apiUrlData = '$apiUrl/api/groups/update/$groupId';
|
||||
} else {
|
||||
apiUrlData = '$apiUrl/api/groups/create';
|
||||
}
|
||||
|
||||
if (token == null) {
|
||||
throw Exception('Token not found. Please log in.');
|
||||
@ -217,7 +225,6 @@ class _groupState extends State<Group> {
|
||||
try {
|
||||
final response = await (isEdit
|
||||
? http.put(
|
||||
// <-- Use PUT for update
|
||||
Uri.parse(apiUrlData),
|
||||
headers: {
|
||||
'Authorization': 'Bearer $token',
|
||||
@ -231,23 +238,86 @@ class _groupState extends State<Group> {
|
||||
'Authorization': 'Bearer $token',
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: jsonEncode(groupData), // Convert map to JSON
|
||||
body: jsonEncode(groupData),
|
||||
));
|
||||
|
||||
if (response.statusCode == 200 || response.statusCode == 201) {
|
||||
print("Plan submitted successfully!");
|
||||
print("Group submitted successfully!");
|
||||
print("Response: ${response.body}");
|
||||
|
||||
context.go('/group');
|
||||
} else {
|
||||
print("Failed to submit plan. Status: ${response.statusCode}");
|
||||
print("Failed to submit group. Status: ${response.statusCode}");
|
||||
print("Error: ${response.body}");
|
||||
}
|
||||
} catch (e) {
|
||||
print(" Error submitting plan: $e");
|
||||
print("Error submitting group: $e");
|
||||
}
|
||||
}
|
||||
|
||||
// Future<void> postGroupData(Map<String, dynamic> groupData) async {
|
||||
// // final String apiUrldata = '$apiUrl/api/groups/create';
|
||||
//
|
||||
// final token = await getToken(); // Fetch token
|
||||
//
|
||||
// print("postGroupData- ${widget.group?['group_id']}");
|
||||
//
|
||||
// if (selectedGroupId == null) {
|
||||
// print("selectedGroupId is null. Cannot proceed.");
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// final int? groupId = int.tryParse(selectedGroupId!);
|
||||
// if (groupId == null) {
|
||||
// print("groupId is invalid. selectedGroupId = $selectedGroupId");
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// final bool isEdit = widget.group != null && widget.group!.isNotEmpty;
|
||||
// print("postGroupData1 - $selectedGroupId");
|
||||
//
|
||||
// // Build correct API URL
|
||||
// final String apiUrlData = isEdit
|
||||
// ? '$apiUrl/api/groups/update/$groupId' // Update API
|
||||
// : '$apiUrl/api/groups/create';
|
||||
//
|
||||
// if (token == null) {
|
||||
// throw Exception('Token not found. Please log in.');
|
||||
// }
|
||||
//
|
||||
// try {
|
||||
// final response = await (isEdit
|
||||
// ? http.put(
|
||||
// // <-- Use PUT for update
|
||||
// Uri.parse(apiUrlData),
|
||||
// headers: {
|
||||
// 'Authorization': 'Bearer $token',
|
||||
// 'Content-Type': 'application/json',
|
||||
// },
|
||||
// body: jsonEncode(groupData),
|
||||
// )
|
||||
// : http.post(
|
||||
// Uri.parse(apiUrlData),
|
||||
// headers: {
|
||||
// 'Authorization': 'Bearer $token',
|
||||
// 'Content-Type': 'application/json',
|
||||
// },
|
||||
// body: jsonEncode(groupData), // Convert map to JSON
|
||||
// ));
|
||||
//
|
||||
// if (response.statusCode == 200 || response.statusCode == 201) {
|
||||
// print("Plan submitted successfully!");
|
||||
// print("Response: ${response.body}");
|
||||
//
|
||||
// context.go('/group');
|
||||
// } else {
|
||||
// print("Failed to submit plan. Status: ${response.statusCode}");
|
||||
// print("Error: ${response.body}");
|
||||
// }
|
||||
// } catch (e) {
|
||||
// print(" Error submitting plan: $e");
|
||||
// }
|
||||
// }
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ResponsiveBuilder(builder: (context, sizingInfo) {
|
||||
@ -260,114 +330,146 @@ class _groupState extends State<Group> {
|
||||
body: Row(
|
||||
children: [
|
||||
if (isDesktop) CustomDrawer(isDesktop: true),
|
||||
Expanded(child: buildOrganizationLayout(isDesktop))
|
||||
Expanded(child: buildData(isDesktop, context))
|
||||
],
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Widget buildData(bool isDesktop, context) {
|
||||
return Container(
|
||||
// margin: const EdgeInsets.only(left: 10.0, right: 15.0, top: 10.0, bottom: 10.0),
|
||||
decoration: BoxDecoration(
|
||||
// color: Colors.amber,
|
||||
color: bodyColor,
|
||||
border: Border.all(color: Color(0xFFF7F7FB), width: 3.5)),
|
||||
child: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
color: bodyColor,
|
||||
child: buildOrganizationLayout(isDesktop),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
color: Colors.white,
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: isDesktop
|
||||
? Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: _buildSubmit(isDesktop),
|
||||
)
|
||||
: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: _buildSubmit(isDesktop),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget buildOrganizationLayout(isDesktop) {
|
||||
return Container(
|
||||
color: bodyColor,
|
||||
// color: Colors.white,
|
||||
width: double.infinity,
|
||||
height: MediaQuery.of(context).size.height,
|
||||
margin: const EdgeInsets.all(8),
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.vertical,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
// color: Colors.white,
|
||||
padding: const EdgeInsets.all(10),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"Create Group",
|
||||
style: TextStyle(fontSize: 18),
|
||||
),
|
||||
Container(
|
||||
color: Color(0xFFE9EBF6),
|
||||
child: IconButton(
|
||||
icon: Icon(
|
||||
Icons.close,
|
||||
),
|
||||
onPressed: () {
|
||||
context.go('/group');
|
||||
},
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
margin: isDesktop
|
||||
? EdgeInsets.all(10.0)
|
||||
: EdgeInsets.only(left: 20.0, bottom: 20.0, top: 10.0, right: 20.0),
|
||||
height: isDesktop
|
||||
? MediaQuery.of(context).size.height * 0.98
|
||||
: MediaQuery.of(context).size.height,
|
||||
decoration: BoxDecoration(
|
||||
border: isDesktop
|
||||
? Border.all(
|
||||
width: 2,
|
||||
color: Color(0xFFF7F7FB),
|
||||
)
|
||||
: null,
|
||||
color: Colors.white,
|
||||
// color: Color(0xFFF7F7FB),
|
||||
|
||||
// color: Colors.amber,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
// color: Colors.white,
|
||||
padding: const EdgeInsets.all(10),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"Create Group",
|
||||
style: TextStyle(fontSize: 18),
|
||||
),
|
||||
// Container(
|
||||
// color: Color(0xFFE9EBF6),
|
||||
// child: IconButton(
|
||||
// icon: Icon(
|
||||
// Icons.close,
|
||||
// ),
|
||||
// onPressed: () {
|
||||
// context.go('/group');
|
||||
// },
|
||||
// ),
|
||||
// )
|
||||
],
|
||||
),
|
||||
// SizedBox(
|
||||
// height: 5,
|
||||
// ),
|
||||
Container(
|
||||
margin: const EdgeInsets.all(10),
|
||||
padding: const EdgeInsets.all(20),
|
||||
color: Colors.white,
|
||||
height: MediaQuery.of(context).size.height * 0.8,
|
||||
child: Column(
|
||||
children: [
|
||||
// Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
// children: [
|
||||
// Text(
|
||||
// "Mail Settings",
|
||||
// style: TextStyle(color: Colors.blueAccent),
|
||||
// ),
|
||||
// Icon(
|
||||
// Icons.keyboard_arrow_down_outlined,
|
||||
// color: Colors.blueAccent,
|
||||
// size: 30,
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
isDesktop
|
||||
? Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: _buildFirstRow(isDesktop),
|
||||
)
|
||||
: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: _buildFirstRow(isDesktop),
|
||||
),
|
||||
),
|
||||
// SizedBox(
|
||||
// height: 5,
|
||||
// ),
|
||||
Container(
|
||||
margin: const EdgeInsets.all(10),
|
||||
padding: const EdgeInsets.all(20),
|
||||
color: Colors.white,
|
||||
height: MediaQuery.of(context).size.height * 0.6,
|
||||
child: Column(
|
||||
children: [
|
||||
// Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
// children: [
|
||||
// Text(
|
||||
// "Mail Settings",
|
||||
// style: TextStyle(color: Colors.blueAccent),
|
||||
// ),
|
||||
// Icon(
|
||||
// Icons.keyboard_arrow_down_outlined,
|
||||
// color: Colors.blueAccent,
|
||||
// size: 30,
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
isDesktop
|
||||
? Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: _buildFirstRow(isDesktop),
|
||||
)
|
||||
: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: _buildFirstRow(isDesktop),
|
||||
),
|
||||
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
|
||||
isDesktop
|
||||
? Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: _buildSecondRow(isDesktop),
|
||||
)
|
||||
: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: _buildSecondRow(isDesktop),
|
||||
),
|
||||
isDesktop
|
||||
? Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: _buildSecondRow(isDesktop),
|
||||
)
|
||||
: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: _buildSecondRow(isDesktop),
|
||||
),
|
||||
|
||||
// SizedBox(height: 15),
|
||||
|
||||
Spacer(),
|
||||
isDesktop
|
||||
? Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: _buildSubmit(isDesktop),
|
||||
)
|
||||
: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: _buildSubmit(isDesktop),
|
||||
)
|
||||
],
|
||||
)),
|
||||
],
|
||||
),
|
||||
// SizedBox(height: 15),
|
||||
],
|
||||
)),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@ -146,12 +146,41 @@ class _GroupListState extends State<GroupList> {
|
||||
|
||||
Widget buildGroupListLayout(bool isDesktop) {
|
||||
return Container(
|
||||
color: bodyColor,
|
||||
// color: Colors.white,
|
||||
width: double.infinity,
|
||||
height: MediaQuery.of(context).size.height,
|
||||
// margin: const EdgeInsets.all(8),
|
||||
padding: const EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
// color: Colors.amber,
|
||||
color: bodyColor,
|
||||
border: Border.all(color: Color(0xFFF7F7FB), width: 3.5)),
|
||||
child: buildGroupData(isDesktop),
|
||||
);
|
||||
}
|
||||
|
||||
// Widget buildGroupListView(bool isDesktop) {
|
||||
// return Container(
|
||||
// child: Text("DAta"),
|
||||
// );
|
||||
// }
|
||||
|
||||
Widget buildGroupData(isDesktop) {
|
||||
return Container(
|
||||
margin: isDesktop
|
||||
? EdgeInsets.all(10.0)
|
||||
: EdgeInsets.only(left: 20.0, bottom: 20.0, top: 10.0, right: 20.0),
|
||||
padding: const EdgeInsets.all(10),
|
||||
height: isDesktop
|
||||
? MediaQuery.of(context).size.height * 0.98
|
||||
: MediaQuery.of(context).size.height,
|
||||
decoration: BoxDecoration(
|
||||
border: isDesktop
|
||||
? Border.all(
|
||||
width: 2,
|
||||
color: Color(0xFFF7F7FB),
|
||||
)
|
||||
: null,
|
||||
color: Colors.white,
|
||||
// color: Color(0xFFF7F7FB),
|
||||
|
||||
// color: Colors.amber,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
@ -171,7 +200,7 @@ class _GroupListState extends State<GroupList> {
|
||||
ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
foregroundColor: Colors.white,
|
||||
backgroundColor: layoutColor,
|
||||
backgroundColor: Color(0xFF114D8B),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
// side: BorderSide(color: , width: 1),
|
||||
@ -204,7 +233,7 @@ class _GroupListState extends State<GroupList> {
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: MediaQuery.of(context).size.height * 0.899,
|
||||
// height: MediaQuery.of(context).size.height * 0.89,
|
||||
padding: const EdgeInsets.all(10),
|
||||
// margin: const EdgeInsets.only(bottom: 10),
|
||||
color: Colors.white,
|
||||
@ -226,12 +255,6 @@ class _GroupListState extends State<GroupList> {
|
||||
);
|
||||
}
|
||||
|
||||
// Widget buildGroupListView(bool isDesktop) {
|
||||
// return Container(
|
||||
// child: Text("DAta"),
|
||||
// );
|
||||
// }
|
||||
|
||||
Widget buildGroupListView(bool isDesktop) {
|
||||
if (apiAllGroups == null || apiAllGroups!.isEmpty) {
|
||||
return Center(child: Text("No groups found."));
|
||||
@ -253,13 +276,26 @@ class _GroupListState extends State<GroupList> {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text("Group Name: ${group['name']}",
|
||||
style:
|
||||
TextStyle(fontSize: 13, fontWeight: FontWeight.bold)),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text("Group Name: ${group['name']}",
|
||||
style: TextStyle(
|
||||
fontSize: 13, fontWeight: FontWeight.bold)),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 4),
|
||||
Text("Description: ${group['description'] ?? 'N/A'}"),
|
||||
Text("Policy: ${group['domestic_policy_id']}"),
|
||||
Text("Created By : ${group['created_by']}"),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
"Policy: ${group['domestic_policy_name'] ?? group['international_policy_name']}")),
|
||||
Expanded(child: Text("${group['description'] ?? 'N/A'}")),
|
||||
Expanded(child: Text(" ${group['created_by']}")),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
|
||||
@ -558,7 +558,7 @@ class _OrgSetUpState extends State<OrgSetUp> {
|
||||
// if (showMail)
|
||||
|
||||
SizedBox(
|
||||
height: 3,
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
// width: double.infinity,
|
||||
@ -595,7 +595,7 @@ class _OrgSetUpState extends State<OrgSetUp> {
|
||||
],
|
||||
)),
|
||||
SizedBox(
|
||||
height: 5,
|
||||
height: 15,
|
||||
),
|
||||
|
||||
Text(
|
||||
@ -607,7 +607,7 @@ class _OrgSetUpState extends State<OrgSetUp> {
|
||||
color: Color(0xFF212121)),
|
||||
),
|
||||
SizedBox(
|
||||
height: 5,
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
@ -634,11 +634,11 @@ class _OrgSetUpState extends State<OrgSetUp> {
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 5,
|
||||
height: 15,
|
||||
),
|
||||
|
||||
Row(
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"Choose Theme",
|
||||
|
||||
@ -126,16 +126,31 @@ class _CreatePlansState extends State<CreatePlan> {
|
||||
// ),
|
||||
Expanded(
|
||||
child: Container(
|
||||
margin: const EdgeInsets.all(8),
|
||||
margin: isDesktop
|
||||
? EdgeInsets.all(10.0)
|
||||
: EdgeInsets.only(
|
||||
left: 20.0, bottom: 20.0, top: 10.0, right: 20.0),
|
||||
padding: const EdgeInsets.all(10),
|
||||
height: isDesktop
|
||||
? MediaQuery.of(context).size.height * 0.98
|
||||
: MediaQuery.of(context).size.height,
|
||||
decoration: BoxDecoration(
|
||||
border: isDesktop
|
||||
? Border.all(
|
||||
width: 2,
|
||||
color: Color(0xFFF7F7FB),
|
||||
)
|
||||
: null,
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(12), // rounds all corners
|
||||
// color: Color(0xFFF7F7FB),
|
||||
|
||||
// color: Colors.amber,
|
||||
),
|
||||
|
||||
// color: bodyColor,
|
||||
child: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(20.0),
|
||||
padding: EdgeInsets.all(10.0),
|
||||
child: CreateNewPlan(
|
||||
key: _createPlanKey,
|
||||
bodyColor: bodyColor,
|
||||
@ -920,6 +935,9 @@ class CreateNewPlansState extends State<CreateNewPlan> {
|
||||
)),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
if (widget.isApprover)
|
||||
Container(
|
||||
padding: const EdgeInsets.all(10),
|
||||
@ -1570,7 +1588,7 @@ class CreateNewPlansState extends State<CreateNewPlan> {
|
||||
? Colors.white
|
||||
: Colors.black,
|
||||
fontWeight: _selectedOption == option["value"]
|
||||
? FontWeight.w600
|
||||
? FontWeight.w500
|
||||
: null,
|
||||
),
|
||||
),
|
||||
@ -1652,7 +1670,7 @@ class CreateNewPlansState extends State<CreateNewPlan> {
|
||||
color:
|
||||
_selectedTripType == "1" ? Colors.white : Colors.black,
|
||||
fontWeight:
|
||||
_selectedTripType == "1" ? FontWeight.w600 : null,
|
||||
_selectedTripType == "1" ? FontWeight.w500 : null,
|
||||
fontSize: 13),
|
||||
),
|
||||
|
||||
@ -1683,6 +1701,7 @@ class CreateNewPlansState extends State<CreateNewPlan> {
|
||||
child: Container(
|
||||
width: 15,
|
||||
height: 15,
|
||||
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.rectangle,
|
||||
// color: _selectedOption == option["value"]
|
||||
@ -1724,7 +1743,7 @@ class CreateNewPlansState extends State<CreateNewPlan> {
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: _selectedTripType == "2" ? Colors.white : Colors.black,
|
||||
fontWeight: _selectedTripType == "2" ? FontWeight.w600 : null,
|
||||
fontWeight: _selectedTripType == "2" ? FontWeight.w500 : null,
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
|
||||
@ -187,18 +187,46 @@ class _ListPlansState extends State<ListPlans> {
|
||||
body: Row(
|
||||
children: [
|
||||
if (isDesktop) CustomDrawer(isDesktop: true),
|
||||
Expanded(child: buildTableLayout(isDesktop))
|
||||
Expanded(child: buildGroupListLayout(isDesktop))
|
||||
],
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Widget buildGroupListLayout(bool isDesktop) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
// color: Colors.amber,
|
||||
color: bodyColor,
|
||||
border: Border.all(color: Color(0xFFF7F7FB), width: 3.5)),
|
||||
child: buildTableLayout(isDesktop),
|
||||
);
|
||||
}
|
||||
|
||||
Widget buildTableLayout(isDesktop) {
|
||||
return Container(
|
||||
color: bodyColor,
|
||||
margin: isDesktop
|
||||
? EdgeInsets.all(10.0)
|
||||
: EdgeInsets.only(left: 20.0, bottom: 20.0, top: 10.0, right: 20.0),
|
||||
padding: const EdgeInsets.all(10),
|
||||
height: isDesktop
|
||||
? MediaQuery.of(context).size.height * 0.98
|
||||
: MediaQuery.of(context).size.height,
|
||||
decoration: BoxDecoration(
|
||||
border: isDesktop
|
||||
? Border.all(
|
||||
width: 2,
|
||||
color: Color(0xFFF7F7FB),
|
||||
)
|
||||
: null,
|
||||
color: Colors.white,
|
||||
// color: Color(0xFFF7F7FB),
|
||||
|
||||
// color: Colors.amber,
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
padding: const EdgeInsets.all(1.0),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
color: Colors.white,
|
||||
|
||||
@ -286,7 +286,7 @@ class PolicyCriteriaState extends State<PolicyCriteria> {
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Text(
|
||||
"Approver Name",
|
||||
"Approver",
|
||||
style: TextStyle(
|
||||
color: Color(0xFF9E9DBD),
|
||||
fontWeight: FontWeight.bold,
|
||||
@ -296,7 +296,7 @@ class PolicyCriteriaState extends State<PolicyCriteria> {
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Text(
|
||||
"Notification",
|
||||
"Actions",
|
||||
style: TextStyle(
|
||||
color: Color(0xFF9E9DBD),
|
||||
fontWeight: FontWeight.bold,
|
||||
@ -304,7 +304,7 @@ class PolicyCriteriaState extends State<PolicyCriteria> {
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"Select",
|
||||
"Parallel Action",
|
||||
style: TextStyle(
|
||||
color: Color(0xFF9E9DBD),
|
||||
fontWeight: FontWeight.bold,
|
||||
|
||||
@ -145,21 +145,44 @@ class _PolicyListState extends State<PolicyList> {
|
||||
body: Row(
|
||||
children: [
|
||||
if (isDesktop) CustomDrawer(isDesktop: true),
|
||||
Expanded(child: buildGroupListLayout(isDesktop))
|
||||
Expanded(child: buildGroupList(isDesktop))
|
||||
],
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Widget buildGroupList(bool isDesktop) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
// color: Colors.amber,
|
||||
color: bodyColor,
|
||||
border: Border.all(color: Color(0xFFF7F7FB), width: 3.5)),
|
||||
child: buildGroupListLayout(isDesktop),
|
||||
);
|
||||
}
|
||||
|
||||
Widget buildGroupListLayout(bool isDesktop) {
|
||||
return Container(
|
||||
color: bodyColor,
|
||||
// color: Colors.white,
|
||||
width: double.infinity,
|
||||
height: MediaQuery.of(context).size.height,
|
||||
// margin: const EdgeInsets.all(8),
|
||||
padding: const EdgeInsets.all(8),
|
||||
margin: isDesktop
|
||||
? EdgeInsets.all(10.0)
|
||||
: EdgeInsets.only(left: 20.0, bottom: 20.0, top: 10.0, right: 20.0),
|
||||
padding: const EdgeInsets.all(10),
|
||||
height: isDesktop
|
||||
? MediaQuery.of(context).size.height * 0.98
|
||||
: MediaQuery.of(context).size.height,
|
||||
decoration: BoxDecoration(
|
||||
border: isDesktop
|
||||
? Border.all(
|
||||
width: 2,
|
||||
color: Color(0xFFF7F7FB),
|
||||
)
|
||||
: null,
|
||||
color: Colors.white,
|
||||
// color: Color(0xFFF7F7FB),
|
||||
|
||||
// color: Colors.amber,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
@ -179,7 +202,7 @@ class _PolicyListState extends State<PolicyList> {
|
||||
ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
foregroundColor: Colors.white,
|
||||
backgroundColor: layoutColor,
|
||||
backgroundColor: Color(0xFF114D8B),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
// side: BorderSide(color: , width: 1),
|
||||
@ -212,7 +235,7 @@ class _PolicyListState extends State<PolicyList> {
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: MediaQuery.of(context).size.height * 0.899,
|
||||
height: MediaQuery.of(context).size.height * 0.8,
|
||||
padding: const EdgeInsets.all(10),
|
||||
// margin: const EdgeInsets.only(bottom: 10),
|
||||
color: Colors.white,
|
||||
|
||||
@ -695,16 +695,30 @@ class _CreateUserFormState extends State<CreateUserForm> {
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
margin: const EdgeInsets.all(8),
|
||||
margin: isDesktop
|
||||
? EdgeInsets.all(10.0)
|
||||
: EdgeInsets.only(
|
||||
left: 20.0, bottom: 20.0, top: 10.0, right: 20.0),
|
||||
padding: const EdgeInsets.all(10),
|
||||
height: isDesktop
|
||||
? MediaQuery.of(context).size.height * 0.98
|
||||
: MediaQuery.of(context).size.height,
|
||||
decoration: BoxDecoration(
|
||||
border: isDesktop
|
||||
? Border.all(
|
||||
width: 2,
|
||||
color: Color(0xFFF7F7FB),
|
||||
)
|
||||
: null,
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(12), // rounds all corners
|
||||
),
|
||||
// color: Color(0xFFF7F7FB),
|
||||
|
||||
// color: Colors.amber,
|
||||
),
|
||||
// color: bodyColor,
|
||||
child: SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(20.0),
|
||||
padding: EdgeInsets.all(0.0),
|
||||
child: _buildUserDetails(isDesktop),
|
||||
),
|
||||
),
|
||||
|
||||
@ -253,7 +253,7 @@ class _UserListScreenState extends State<UserListScreen> {
|
||||
children: [
|
||||
if (isDesktop) CustomDrawer(isDesktop: true),
|
||||
// const Expanded(child: Center(child: Text("User Page Content"))),
|
||||
Expanded(child: buildUserTable(isDesktop)),
|
||||
Expanded(child: buildGroupList(isDesktop)),
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -261,9 +261,37 @@ class _UserListScreenState extends State<UserListScreen> {
|
||||
});
|
||||
}
|
||||
|
||||
Widget buildGroupList(bool isDesktop) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
// color: Colors.amber,
|
||||
color: bodyColor,
|
||||
border: Border.all(color: Color(0xFFF7F7FB), width: 3.5)),
|
||||
child: buildUserTable(isDesktop),
|
||||
);
|
||||
}
|
||||
|
||||
Widget buildUserTable(bool isDesktop) {
|
||||
return Container(
|
||||
color: bodyColor,
|
||||
margin: isDesktop
|
||||
? EdgeInsets.all(10.0)
|
||||
: EdgeInsets.only(left: 20.0, bottom: 20.0, top: 10.0, right: 20.0),
|
||||
// padding: const EdgeInsets.all(10),
|
||||
height: isDesktop
|
||||
? MediaQuery.of(context).size.height * 0.98
|
||||
: MediaQuery.of(context).size.height,
|
||||
decoration: BoxDecoration(
|
||||
border: isDesktop
|
||||
? Border.all(
|
||||
width: 2,
|
||||
color: Color(0xFFF7F7FB),
|
||||
)
|
||||
: null,
|
||||
color: Colors.white,
|
||||
// color: Color(0xFFF7F7FB),
|
||||
|
||||
// color: Colors.amber,
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
child: Container(
|
||||
|
||||
@ -136,14 +136,15 @@ class _CustomDrawerState extends State<CustomDrawer> {
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
selectedOrg?['logo'] != null
|
||||
? ClipOval(
|
||||
? ClipRect(
|
||||
child: Image.network(
|
||||
selectedOrg!['logo'],
|
||||
width: 50,
|
||||
width: 150,
|
||||
height: 50,
|
||||
fit: BoxFit.cover,
|
||||
fit: BoxFit.fitWidth,
|
||||
errorBuilder: (context, error, stackTrace) {
|
||||
return const CircleAvatar(
|
||||
radius: 20,
|
||||
@ -155,8 +156,12 @@ class _CustomDrawerState extends State<CustomDrawer> {
|
||||
)
|
||||
: const CircleAvatar(
|
||||
radius: 20,
|
||||
backgroundColor: Colors.amber,
|
||||
child: Icon(Icons.add_a_photo, size: 10),
|
||||
backgroundColor: Colors.white,
|
||||
child: Icon(
|
||||
Icons.add_a_photo,
|
||||
size: 10,
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user