Refactor EmployeeScreen to use Obx for loading state and remove commented-out action buttons
This commit is contained in:
parent
7281794fcf
commit
fb2823c340
@ -41,9 +41,11 @@ class _EmployeeScreenState extends State<EmployeeScreen> with UIMixin {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Layout(
|
||||
child: Stack(
|
||||
children: [
|
||||
GetBuilder<EmployeesScreenController>(
|
||||
child: Obx(() {
|
||||
return LoadingComponent(
|
||||
isLoading: employeesScreenController.isLoading.value,
|
||||
loadingText: 'Loading Employees...',
|
||||
child: GetBuilder<EmployeesScreenController>(
|
||||
init: employeesScreenController,
|
||||
builder: (controller) {
|
||||
return Column(
|
||||
@ -155,22 +157,8 @@ class _EmployeeScreenState extends State<EmployeeScreen> with UIMixin {
|
||||
);
|
||||
},
|
||||
),
|
||||
Obx(() {
|
||||
return employeesScreenController.isLoading.value
|
||||
? Container(
|
||||
color: Colors.black.withOpacity(0.05),
|
||||
child: const Center(
|
||||
child: LoadingComponent(
|
||||
isLoading: true,
|
||||
loadingText: 'Loading Employees...',
|
||||
child: SizedBox.shrink(),
|
||||
),
|
||||
),
|
||||
)
|
||||
: const SizedBox.shrink();
|
||||
}),
|
||||
],
|
||||
),
|
||||
);
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
@ -186,8 +174,6 @@ class _EmployeeScreenState extends State<EmployeeScreen> with UIMixin {
|
||||
DataColumn(label: MyText.labelLarge('Name', color: contentTheme.primary)),
|
||||
DataColumn(
|
||||
label: MyText.labelLarge('Contact', color: contentTheme.primary)),
|
||||
// DataColumn(
|
||||
// label: MyText.labelLarge('Actions', color: contentTheme.primary)),
|
||||
];
|
||||
|
||||
final rows =
|
||||
@ -217,26 +203,6 @@ class _EmployeeScreenState extends State<EmployeeScreen> with UIMixin {
|
||||
],
|
||||
),
|
||||
),
|
||||
// DataCell(
|
||||
// Row(
|
||||
// children: [
|
||||
// IconButton(
|
||||
// icon: const Icon(Icons.visibility),
|
||||
// tooltip: 'View',
|
||||
// onPressed: () {
|
||||
// // View employee action
|
||||
// },
|
||||
// ),
|
||||
// IconButton(
|
||||
// icon: const Icon(Icons.edit),
|
||||
// tooltip: 'Edit',
|
||||
// onPressed: () {
|
||||
// // Edit employee action
|
||||
// },
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
);
|
||||
}).toList();
|
||||
|
Loading…
x
Reference in New Issue
Block a user