Hapus variabel textTheme yang tidak digunakan di tampilan Petugas Desa
- Hapus variabel textTheme yang tidak dipakai di PengaduanView, PenitipanView, dan PenyaluranView - Sederhanakan kode dengan menghapus deklarasi variabel yang tidak diperlukan - Pertahankan struktur dasar tampilan yang sudah ada
This commit is contained in:
@ -8,8 +8,6 @@ class PengaduanView extends GetView<PetugasDesaController> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final textTheme = Theme.of(context).textTheme;
|
|
||||||
|
|
||||||
return SingleChildScrollView(
|
return SingleChildScrollView(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(16.0),
|
||||||
|
@ -8,8 +8,6 @@ class PenitipanView extends GetView<PetugasDesaController> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final textTheme = Theme.of(context).textTheme;
|
|
||||||
|
|
||||||
return SingleChildScrollView(
|
return SingleChildScrollView(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(16.0),
|
||||||
|
@ -10,8 +10,6 @@ class PenyaluranView extends GetView<PetugasDesaController> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final textTheme = Theme.of(context).textTheme;
|
|
||||||
|
|
||||||
return SingleChildScrollView(
|
return SingleChildScrollView(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(16.0),
|
||||||
|
@ -22,23 +22,185 @@ class PermintaanPenjadwalanView extends GetView<PetugasDesaController> {
|
|||||||
onPressed: () => Get.back(),
|
onPressed: () => Get.back(),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
body: Obx(() {
|
body: SingleChildScrollView(
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(16.0),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
// Ringkasan permintaan penjadwalan
|
||||||
|
_buildPenjadwalanSummary(context),
|
||||||
|
|
||||||
|
const SizedBox(height: 24),
|
||||||
|
|
||||||
|
// Filter dan pencarian
|
||||||
|
_buildFilterSearch(context),
|
||||||
|
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
|
||||||
|
// Daftar permintaan penjadwalan
|
||||||
|
_buildPenjadwalanList(context),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildPenjadwalanSummary(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
width: double.infinity,
|
||||||
|
padding: const EdgeInsets.all(16),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
gradient: AppTheme.primaryGradient,
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'Ringkasan Permintaan Penjadwalan',
|
||||||
|
style: Theme.of(context).textTheme.titleLarge?.copyWith(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 16),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: _buildSummaryItem(
|
||||||
|
context,
|
||||||
|
icon: Icons.pending_actions,
|
||||||
|
title: 'Menunggu',
|
||||||
|
value: '${controller.jumlahPermintaanPenjadwalan.value}',
|
||||||
|
color: Colors.orange,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: _buildSummaryItem(
|
||||||
|
context,
|
||||||
|
icon: Icons.check_circle,
|
||||||
|
title: 'Terkonfirmasi',
|
||||||
|
value: '0',
|
||||||
|
color: Colors.green,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: _buildSummaryItem(
|
||||||
|
context,
|
||||||
|
icon: Icons.cancel,
|
||||||
|
title: 'Ditolak',
|
||||||
|
value: '0',
|
||||||
|
color: Colors.red,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildSummaryItem(
|
||||||
|
BuildContext context, {
|
||||||
|
required IconData icon,
|
||||||
|
required String title,
|
||||||
|
required String value,
|
||||||
|
required Color color,
|
||||||
|
}) {
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
padding: const EdgeInsets.all(10),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white.withOpacity(0.2),
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
),
|
||||||
|
child: Icon(
|
||||||
|
icon,
|
||||||
|
color: Colors.white,
|
||||||
|
size: 24,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 8),
|
||||||
|
Text(
|
||||||
|
value,
|
||||||
|
style: Theme.of(context).textTheme.titleMedium?.copyWith(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 4),
|
||||||
|
Text(
|
||||||
|
title,
|
||||||
|
style: Theme.of(context).textTheme.bodySmall?.copyWith(
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildFilterSearch(BuildContext context) {
|
||||||
|
return Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: TextField(
|
||||||
|
decoration: InputDecoration(
|
||||||
|
hintText: 'Cari permintaan...',
|
||||||
|
prefixIcon: const Icon(Icons.search),
|
||||||
|
border: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
borderSide: BorderSide.none,
|
||||||
|
),
|
||||||
|
filled: true,
|
||||||
|
fillColor: Colors.grey.shade100,
|
||||||
|
contentPadding: const EdgeInsets.symmetric(vertical: 0),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 12),
|
||||||
|
Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.grey.shade100,
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
),
|
||||||
|
child: IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
// Tampilkan dialog filter
|
||||||
|
},
|
||||||
|
icon: const Icon(Icons.filter_list),
|
||||||
|
tooltip: 'Filter',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildPenjadwalanList(BuildContext context) {
|
||||||
|
return Obx(() {
|
||||||
final permintaanList = controller.permintaanPenjadwalan;
|
final permintaanList = controller.permintaanPenjadwalan;
|
||||||
|
|
||||||
if (permintaanList.isEmpty) {
|
if (permintaanList.isEmpty) {
|
||||||
return _buildEmptyState();
|
return _buildEmptyState();
|
||||||
}
|
}
|
||||||
|
|
||||||
return ListView.builder(
|
return Column(
|
||||||
padding: const EdgeInsets.all(16),
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
itemCount: permintaanList.length,
|
children: [
|
||||||
itemBuilder: (context, index) {
|
Text(
|
||||||
final permintaan = permintaanList[index];
|
'Daftar Permintaan Penjadwalan',
|
||||||
return _buildPermintaanItem(context, permintaan);
|
style: Theme.of(context).textTheme.titleLarge?.copyWith(
|
||||||
},
|
fontWeight: FontWeight.bold,
|
||||||
);
|
),
|
||||||
}),
|
),
|
||||||
|
const SizedBox(height: 12),
|
||||||
|
...permintaanList.map((item) => _buildPermintaanItem(context, item)),
|
||||||
|
],
|
||||||
);
|
);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildEmptyState() {
|
Widget _buildEmptyState() {
|
||||||
@ -74,19 +236,24 @@ class PermintaanPenjadwalanView extends GetView<PetugasDesaController> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildPermintaanItem(
|
Widget _buildPermintaanItem(BuildContext context, Map<String, dynamic> item) {
|
||||||
BuildContext context, Map<String, dynamic> permintaan) {
|
Color statusColor = Colors.orange;
|
||||||
final textTheme = Theme.of(context).textTheme;
|
IconData statusIcon = Icons.pending_actions;
|
||||||
|
|
||||||
return Card(
|
return Container(
|
||||||
margin: const EdgeInsets.only(bottom: 16),
|
width: double.infinity,
|
||||||
elevation: 2,
|
margin: const EdgeInsets.only(bottom: 12),
|
||||||
shape: RoundedRectangleBorder(
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(12),
|
||||||
side: BorderSide(
|
boxShadow: [
|
||||||
color: Colors.orange.withAlpha(50),
|
BoxShadow(
|
||||||
width: 1,
|
color: Colors.grey.withAlpha(26),
|
||||||
|
spreadRadius: 1,
|
||||||
|
blurRadius: 3,
|
||||||
|
offset: const Offset(0, 1),
|
||||||
),
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(16.0),
|
padding: const EdgeInsets.all(16.0),
|
||||||
@ -96,59 +263,117 @@ class PermintaanPenjadwalanView extends GetView<PetugasDesaController> {
|
|||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Expanded(
|
||||||
permintaan['nama'] ?? '',
|
child: Text(
|
||||||
style: textTheme.titleMedium?.copyWith(
|
item['nama'] ?? '',
|
||||||
|
style: Theme.of(context).textTheme.titleMedium?.copyWith(
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
padding:
|
padding:
|
||||||
const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.orange.withAlpha(26),
|
color: statusColor.withOpacity(0.1),
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(8),
|
||||||
),
|
),
|
||||||
child: Text(
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
statusIcon,
|
||||||
|
size: 16,
|
||||||
|
color: statusColor,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 4),
|
||||||
|
Text(
|
||||||
'Menunggu',
|
'Menunggu',
|
||||||
style: textTheme.bodySmall?.copyWith(
|
style: Theme.of(context).textTheme.bodySmall?.copyWith(
|
||||||
color: Colors.orange,
|
color: statusColor,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: 12),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: _buildItemDetail(
|
||||||
|
context,
|
||||||
|
icon: Icons.person,
|
||||||
|
label: 'NIK',
|
||||||
|
value: item['nik'] ?? '',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: _buildItemDetail(
|
||||||
|
context,
|
||||||
|
icon: Icons.category,
|
||||||
|
label: 'Jenis Bantuan',
|
||||||
|
value: item['jenis_bantuan'] ?? '',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: 8),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: _buildItemDetail(
|
||||||
|
context,
|
||||||
|
icon: Icons.calendar_today,
|
||||||
|
label: 'Tanggal Permintaan',
|
||||||
|
value: item['tanggal_permintaan'] ?? '',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: _buildItemDetail(
|
||||||
|
context,
|
||||||
|
icon: Icons.location_on,
|
||||||
|
label: 'Alamat',
|
||||||
|
value: item['alamat'] ?? '',
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
_buildInfoRow(Icons.person, 'NIK: ${permintaan['nik'] ?? ''}'),
|
|
||||||
_buildInfoRow(Icons.category,
|
|
||||||
'Jenis Bantuan: ${permintaan['jenis_bantuan'] ?? ''}'),
|
|
||||||
_buildInfoRow(Icons.calendar_today,
|
|
||||||
'Tanggal Permintaan: ${permintaan['tanggal_permintaan'] ?? ''}'),
|
|
||||||
_buildInfoRow(
|
|
||||||
Icons.location_on, 'Alamat: ${permintaan['alamat'] ?? ''}'),
|
|
||||||
const SizedBox(height: 16),
|
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
OutlinedButton.icon(
|
TextButton.icon(
|
||||||
onPressed: () => _showTolakDialog(permintaan),
|
onPressed: () => _showTolakDialog(item),
|
||||||
style: OutlinedButton.styleFrom(
|
icon: const Icon(Icons.close, size: 18),
|
||||||
foregroundColor: Colors.red,
|
|
||||||
side: const BorderSide(color: Colors.red),
|
|
||||||
),
|
|
||||||
icon: const Icon(Icons.close),
|
|
||||||
label: const Text('Tolak'),
|
label: const Text('Tolak'),
|
||||||
|
style: TextButton.styleFrom(
|
||||||
|
foregroundColor: Colors.red,
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 12),
|
|
||||||
ElevatedButton.icon(
|
|
||||||
onPressed: () => _showKonfirmasiDialog(permintaan),
|
|
||||||
style: ElevatedButton.styleFrom(
|
|
||||||
backgroundColor: AppTheme.primaryColor,
|
|
||||||
foregroundColor: Colors.white,
|
|
||||||
),
|
),
|
||||||
icon: const Icon(Icons.check),
|
TextButton.icon(
|
||||||
|
onPressed: () => _showKonfirmasiDialog(item),
|
||||||
|
icon: const Icon(Icons.check, size: 18),
|
||||||
label: const Text('Konfirmasi'),
|
label: const Text('Konfirmasi'),
|
||||||
|
style: TextButton.styleFrom(
|
||||||
|
foregroundColor: Colors.green,
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
TextButton.icon(
|
||||||
|
onPressed: () {
|
||||||
|
// Implementasi untuk melihat detail permintaan
|
||||||
|
},
|
||||||
|
icon: const Icon(Icons.info_outline, size: 18),
|
||||||
|
label: const Text('Detail'),
|
||||||
|
style: TextButton.styleFrom(
|
||||||
|
foregroundColor: Colors.blue,
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -158,28 +383,39 @@ class PermintaanPenjadwalanView extends GetView<PetugasDesaController> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildInfoRow(IconData icon, String text) {
|
Widget _buildItemDetail(
|
||||||
return Padding(
|
BuildContext context, {
|
||||||
padding: const EdgeInsets.only(bottom: 8),
|
required IconData icon,
|
||||||
child: Row(
|
required String label,
|
||||||
|
required String value,
|
||||||
|
}) {
|
||||||
|
return Row(
|
||||||
children: [
|
children: [
|
||||||
Icon(
|
Icon(
|
||||||
icon,
|
icon,
|
||||||
size: 16,
|
size: 16,
|
||||||
color: Colors.grey.shade600,
|
color: Colors.grey,
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 4),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Column(
|
||||||
text,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
style: TextStyle(
|
children: [
|
||||||
fontSize: 14,
|
Text(
|
||||||
color: Colors.grey.shade800,
|
label,
|
||||||
|
style: Theme.of(context).textTheme.bodySmall?.copyWith(
|
||||||
|
color: Colors.grey,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Text(
|
||||||
|
value,
|
||||||
|
style: Theme.of(context).textTheme.bodyMedium,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +19,6 @@ class PetugasDesaView extends GetView<PetugasDesaController> {
|
|||||||
// Perbarui counter pengaduan secara manual saat aplikasi dimulai
|
// Perbarui counter pengaduan secara manual saat aplikasi dimulai
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
controller.updatePengaduanCounter();
|
controller.updatePengaduanCounter();
|
||||||
print('Counter pengaduan diperbarui saat aplikasi dimulai');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
@ -283,8 +282,6 @@ class PetugasDesaView extends GetView<PetugasDesaController> {
|
|||||||
)),
|
)),
|
||||||
Obx(() {
|
Obx(() {
|
||||||
final int jumlahPengaduanDiproses = controller.jumlahDiproses.value;
|
final int jumlahPengaduanDiproses = controller.jumlahDiproses.value;
|
||||||
print(
|
|
||||||
'Drawer - Jumlah pengaduan diproses: $jumlahPengaduanDiproses');
|
|
||||||
|
|
||||||
return ListTile(
|
return ListTile(
|
||||||
leading: Stack(
|
leading: Stack(
|
||||||
@ -414,9 +411,6 @@ class PetugasDesaView extends GetView<PetugasDesaController> {
|
|||||||
print('Jumlah jadwal hari ini: ${controller.jadwalHariIni.length}');
|
print('Jumlah jadwal hari ini: ${controller.jadwalHariIni.length}');
|
||||||
|
|
||||||
return Obx(() {
|
return Obx(() {
|
||||||
// Hitung jumlah pengaduan yang diproses
|
|
||||||
final int jumlahPengaduanDiproses = controller.jumlahDiproses.value;
|
|
||||||
|
|
||||||
return BottomNavigationBar(
|
return BottomNavigationBar(
|
||||||
currentIndex: controller.activeTabIndex.value,
|
currentIndex: controller.activeTabIndex.value,
|
||||||
onTap: controller.changeTab,
|
onTap: controller.changeTab,
|
||||||
|
Reference in New Issue
Block a user