update screen with employee should place at same place after selecting

This commit is contained in:
Manish 2025-11-25 15:30:06 +05:30
parent bb723b91e5
commit e2bee52820

View File

@ -63,14 +63,6 @@ class _MultipleSelectRoleBottomSheetState
employees.where((emp) => emp.jobRoleID == widget.roleId).toList();
}
employees.sort((a, b) {
final aSel = _selected.any((e) => e.id == a.id) ? 0 : 1;
final bSel = _selected.any((e) => e.id == b.id) ? 0 : 1;
return aSel != bSel
? aSel.compareTo(bSel)
: a.name.toLowerCase().compareTo(b.name.toLowerCase());
});
_employees.assignAll(employees);
_filtered.assignAll(employees);
} catch (e) {
@ -90,14 +82,6 @@ class _MultipleSelectRoleBottomSheetState
e.designation.toLowerCase().contains(text.toLowerCase())),
);
}
_filtered.sort((a, b) {
final aSel = _selected.any((e) => e.id == a.id) ? 0 : 1;
final bSel = _selected.any((e) => e.id == b.id) ? 0 : 1;
return aSel != bSel
? aSel.compareTo(bSel)
: a.name.toLowerCase().compareTo(b.name.toLowerCase());
});
}
void _onTap(EmployeeModel emp) {