Refactor EmployeeScreen to use Flexible widget for better layout and enhance project selection display with dropdown icon #25
@ -72,7 +72,7 @@ class _EmployeeScreenState extends State<EmployeeScreen> with UIMixin {
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Expanded(
|
||||
Flexible(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
@ -120,19 +120,33 @@ class _EmployeeScreenState extends State<EmployeeScreen> with UIMixin {
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 12.0, vertical: 8.0),
|
||||
child: Text(
|
||||
employeesScreenController.selectedProjectId ==
|
||||
null
|
||||
? 'All Employees'
|
||||
: employeesScreenController.projects
|
||||
.firstWhere((project) =>
|
||||
project.id ==
|
||||
employeesScreenController
|
||||
.selectedProjectId)
|
||||
.name,
|
||||
overflow: TextOverflow
|
||||
.ellipsis,
|
||||
style: TextStyle(fontWeight: FontWeight.w600),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Flexible(
|
||||
child: Text(
|
||||
employeesScreenController
|
||||
.selectedProjectId ==
|
||||
null
|
||||
? 'All Employees'
|
||||
: employeesScreenController.projects
|
||||
.firstWhere((project) =>
|
||||
project.id ==
|
||||
employeesScreenController
|
||||
.selectedProjectId)
|
||||
.name,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
const Icon(
|
||||
Icons.arrow_drop_down,
|
||||
size: 20,
|
||||
color: Colors.black,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
Loading…
x
Reference in New Issue
Block a user