Refactor EmployeeScreen to use Flexible widget for better layout and enhance project selection display with dropdown icon
This commit is contained in:
parent
e460b97b43
commit
b66878bc0d
@ -72,7 +72,7 @@ class _EmployeeScreenState extends State<EmployeeScreen> with UIMixin {
|
|||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Flexible(
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
@ -120,19 +120,33 @@ class _EmployeeScreenState extends State<EmployeeScreen> with UIMixin {
|
|||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
horizontal: 12.0, vertical: 8.0),
|
horizontal: 12.0, vertical: 8.0),
|
||||||
child: Text(
|
child: Row(
|
||||||
employeesScreenController.selectedProjectId ==
|
mainAxisSize: MainAxisSize.min,
|
||||||
null
|
children: [
|
||||||
? 'All Employees'
|
Flexible(
|
||||||
: employeesScreenController.projects
|
child: Text(
|
||||||
.firstWhere((project) =>
|
employeesScreenController
|
||||||
project.id ==
|
.selectedProjectId ==
|
||||||
employeesScreenController
|
null
|
||||||
.selectedProjectId)
|
? 'All Employees'
|
||||||
.name,
|
: employeesScreenController.projects
|
||||||
overflow: TextOverflow
|
.firstWhere((project) =>
|
||||||
.ellipsis,
|
project.id ==
|
||||||
style: TextStyle(fontWeight: FontWeight.w600),
|
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