fixed the assign project to eployeee issue after creating employee and added fabicon on expense details screen for assign to project
This commit is contained in:
parent
f62b7d924b
commit
44bbbf9bfb
@ -11,6 +11,7 @@ import 'package:marco/helpers/widgets/my_refresh_indicator.dart';
|
||||
import 'package:marco/model/employees/add_employee_bottom_sheet.dart';
|
||||
import 'package:marco/helpers/utils/mixins/ui_mixin.dart';
|
||||
import 'package:marco/helpers/widgets/my_custom_skeleton.dart';
|
||||
import 'package:marco/view/employees/assign_employee_bottom_sheet.dart';
|
||||
|
||||
class EmployeeDetailPage extends StatefulWidget {
|
||||
final String employeeId;
|
||||
@ -424,6 +425,32 @@ class _EmployeeDetailPageState extends State<EmployeeDetailPage> with UIMixin {
|
||||
),
|
||||
);
|
||||
}),
|
||||
|
||||
// Floating “Assign to Project” FAB
|
||||
floatingActionButton: Obx(() {
|
||||
final employee = controller.selectedEmployeeDetails.value;
|
||||
if (employee == null) return const SizedBox.shrink();
|
||||
|
||||
return FloatingActionButton.extended(
|
||||
onPressed: () {
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
isScrollControlled: true,
|
||||
backgroundColor: Colors.transparent,
|
||||
builder: (context) => AssignProjectBottomSheet(
|
||||
employeeId: widget.employeeId,
|
||||
jobRoleId: employee.jobRoleId,
|
||||
),
|
||||
);
|
||||
},
|
||||
backgroundColor: contentTheme.primary,
|
||||
label: const Text(
|
||||
'Assign to Project',
|
||||
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w500),
|
||||
),
|
||||
icon: const Icon(Icons.add),
|
||||
);
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -99,7 +99,7 @@ class _EmployeesScreenState extends State<EmployeesScreen> with UIMixin {
|
||||
backgroundColor: Colors.transparent,
|
||||
builder: (_) => AssignProjectBottomSheet(
|
||||
employeeId: employeeId,
|
||||
jobRoleId: '', // no jobRoleId required
|
||||
jobRoleId: employeeData['jobRoleId'] as String,
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user