Tambahkan CounterService untuk manajemen counter di seluruh modul

- Buat CounterService untuk mengelola counter di berbagai controller
- Refaktor PetugasDesaController dan PenitipanBantuanController untuk menggunakan CounterService
- Perbarui binding untuk mendaftarkan CounterService
- Tambahkan metode update untuk berbagai jenis counter
- Sederhanakan manajemen state dengan menggunakan layanan pusat
This commit is contained in:
Khafidh Fuadi
2025-03-12 07:32:33 +07:00
parent 9995239115
commit 8a3b23d4ea
5 changed files with 165 additions and 54 deletions

View File

@ -94,40 +94,7 @@ class PetugasDesaView extends GetView<PetugasDesaController> {
],
);
// Tombol tambah untuk jadwal dan stok bantuan
if (activeTab == 1) {
return Row(
mainAxisSize: MainAxisSize.min,
children: [
IconButton(
icon: const Icon(Icons.add),
tooltip: 'Tambah Jadwal',
onPressed: () {
// Implementasi untuk menambah jadwal baru
},
),
notificationButton,
],
);
} else if (activeTab == 2) {
return Row(
mainAxisSize: MainAxisSize.min,
children: [
IconButton(
icon: const Icon(Icons.add),
tooltip: 'Tambah Stok Bantuan',
onPressed: () {
// Implementasi untuk menambah stok bantuan baru
},
),
notificationButton,
],
);
} else if (activeTab == 4) {
return notificationButton;
} else {
return notificationButton;
}
return notificationButton;
}),
],
),