Manish_Dev_13/12 #93

Closed
manish.zure wants to merge 3 commits from Manish_Dev_13/12 into Decription_Feature
2 changed files with 89 additions and 69 deletions

View File

@ -396,11 +396,10 @@ class _ManageReportingBottomSheetState
],
);
// 🔥 WRAP EVERYTHING IN SAFEAREA + SCROLL + BOTTOM PADDING
final safeWrappedContent = SafeArea(
child: SingleChildScrollView(
padding: EdgeInsets.only(
bottom: MediaQuery.of(context).viewPadding.bottom + 20,
bottom: 8,
left: 16,
right: 16,
top: 8,
@ -474,7 +473,7 @@ class _ManageReportingBottomSheetState
_searchBar(
controller: controller,
focusNode: focusNode,
focusNode: focusNode,
hint: "Type to search employees...",
),
@ -641,33 +640,47 @@ class _ManageReportingBottomSheetState
required FocusNode focusNode,
required String hint,
}) {
return GestureDetector(
onTap: () => focusNode.requestFocus(),
child: Container(
height: 44,
padding: const EdgeInsets.symmetric(horizontal: 12),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
border: Border.all(color: Colors.grey.shade300),
color: Colors.white,
),
child: Row(
children: [
const Icon(Icons.search, size: 18, color: Colors.grey),
const SizedBox(width: 8),
Expanded(
child: TextField(
controller: controller,
focusNode: focusNode,
decoration: InputDecoration(
hintText: hint,
border: InputBorder.none,
isDense: true,
),
style: const TextStyle(fontSize: 13),
),
return SizedBox(
height: 48,
child: TextField(
controller: controller,
focusNode: focusNode,
style: const TextStyle(fontSize: 14),
decoration: InputDecoration(
hintText: hint,
hintStyle: const TextStyle(
fontSize: 14,
color: Colors.grey,
),
filled: true,
fillColor: Colors.grey.shade100,
prefixIcon: const Padding(
padding: EdgeInsets.only(left: 12, right: 8),
child: Icon(Icons.search, size: 18, color: Colors.grey),
),
prefixIconConstraints: const BoxConstraints(
minWidth: 32,
minHeight: 32,
),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: BorderSide(color: Colors.grey.shade300),
),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: BorderSide(color: Colors.grey.shade300),
),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(12),
borderSide: const BorderSide(
color: Colors.blueAccent,
width: 1.5,
),
],
),
contentPadding:
const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
isDense: true,
),
),
);

View File

@ -15,7 +15,6 @@ import 'package:on_field_work/helpers/services/api_service.dart';
import 'package:on_field_work/helpers/utils/base_bottom_sheet.dart';
import 'package:on_field_work/model/infra_project/assign_project_allocation_request.dart';
class JobRole {
final String id;
final String name;
@ -138,12 +137,18 @@ class _AssignEmployeeBottomSheetState extends State<AssignEmployeeBottomSheet> {
);
if (res?.success == true) {
Navigator.of(context).pop(true); // 🔥 triggers refresh
Navigator.of(context).pop(true);
} else {
Get.snackbar('Error', res?.message ?? 'Assignment failed');
}
}
BoxDecoration _boxDecoration() => BoxDecoration(
color: Colors.grey.shade100,
borderRadius: BorderRadius.circular(12),
border: Border.all(color: Colors.grey.shade300),
);
@override
Widget build(BuildContext context) {
return BaseBottomSheet(
@ -156,34 +161,36 @@ class _AssignEmployeeBottomSheetState extends State<AssignEmployeeBottomSheet> {
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
//ORGANIZATION
MyText.bodySmall(
/// ORGANIZATION
MyText.labelMedium(
'Organization',
fontWeight: 600,
color: Colors.grey.shade700,
),
MySpacing.height(6),
MySpacing.height(8),
OrganizationSelector(
controller: _organizationController,
height: 44,
onSelectionChanged: (Organization? org) async {
_selectedOrganization = org;
_selectedEmployees.clear();
_selectedRole = null;
_serviceController.clearSelection();
},
Container(
height: 48,
decoration: _boxDecoration(),
child: OrganizationSelector(
controller: _organizationController,
height: 48,
onSelectionChanged: (Organization? org) async {
_selectedOrganization = org;
_selectedEmployees.clear();
_selectedRole = null;
_serviceController.clearSelection();
},
),
),
MySpacing.height(20),
///EMPLOYEES (SEARCH)
MyText.bodySmall(
/// EMPLOYEES
MyText.labelMedium(
'Employees',
fontWeight: 600,
color: Colors.grey.shade700,
),
MySpacing.height(6),
MySpacing.height(8),
Obx(
() => InkWell(
@ -199,31 +206,33 @@ class _AssignEmployeeBottomSheetState extends State<AssignEmployeeBottomSheet> {
MySpacing.height(20),
///SERVICE
MyText.bodySmall(
/// SERVICE
MyText.labelMedium(
'Service',
fontWeight: 600,
color: Colors.grey.shade700,
),
MySpacing.height(6),
MySpacing.height(8),
ServiceSelector(
controller: _serviceController,
height: 44,
onSelectionChanged: (Service? service) async {
_selectedRole = null;
},
Container(
height: 48,
decoration: _boxDecoration(),
child: ServiceSelector(
controller: _serviceController,
height: 48,
onSelectionChanged: (Service? service) async {
_selectedRole = null;
},
),
),
MySpacing.height(20),
/// JOB ROLE
MyText.bodySmall(
MyText.labelMedium(
'Job Role',
fontWeight: 600,
color: Colors.grey.shade700,
),
MySpacing.height(6),
MySpacing.height(8),
Obx(() {
if (_isLoadingRoles.value) {
@ -231,6 +240,7 @@ class _AssignEmployeeBottomSheetState extends State<AssignEmployeeBottomSheet> {
}
return PopupMenuButton<JobRole>(
offset: const Offset(0, 48),
onSelected: (role) {
_selectedRole = role;
setState(() {});
@ -265,12 +275,9 @@ class _AssignEmployeeBottomSheetState extends State<AssignEmployeeBottomSheet> {
Widget _dropdownBox(String text, {IconData icon = Icons.arrow_drop_down}) {
return Container(
height: 44,
padding: const EdgeInsets.symmetric(horizontal: 12),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
border: Border.all(color: Colors.grey.shade300),
),
height: 48,
padding: const EdgeInsets.symmetric(horizontal: 16),
decoration: _boxDecoration(),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
@ -278,7 +285,7 @@ class _AssignEmployeeBottomSheetState extends State<AssignEmployeeBottomSheet> {
child: Text(
text,
overflow: TextOverflow.ellipsis,
style: const TextStyle(fontSize: 13),
style: const TextStyle(fontSize: 14),
),
),
Icon(icon, color: Colors.grey),
@ -289,7 +296,7 @@ class _AssignEmployeeBottomSheetState extends State<AssignEmployeeBottomSheet> {
Widget _skeleton() {
return Container(
height: 44,
height: 48,
decoration: BoxDecoration(
color: Colors.grey.shade300,
borderRadius: BorderRadius.circular(12),