Perbarui model dan tampilan untuk mendukung status penyaluran dalam aplikasi. Tambahkan properti statusPenyaluran pada PenerimaPenyaluranModel dan SkemaBantuanModel. Modifikasi tampilan di BantuanCard dan StatusBadge untuk menampilkan status penyaluran dengan lebih baik. Hapus penggunaan prioritas di beberapa model dan tampilan untuk menyederhanakan kode. Implementasikan logika baru di JadwalPenyaluranController untuk memperbarui stok bantuan berdasarkan jumlah yang diterima.
This commit is contained in:
@ -916,36 +916,12 @@ class WargaDetailPengaduanView extends GetView<WargaDashboardController> {
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
// Prioritas tindakan (jika ada)
|
||||
if (tindakan.prioritas != null) ...[
|
||||
const SizedBox(height: 8),
|
||||
// Menggunakan StatusPill untuk prioritas tindakan
|
||||
StatusPill(
|
||||
status: tindakan.prioritasText,
|
||||
backgroundColor: _getPriorityColor(tindakan.prioritas),
|
||||
textColor: Colors.white,
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Color _getPriorityColor(String? priority) {
|
||||
switch (priority) {
|
||||
case 'TINGGI':
|
||||
return Colors.red;
|
||||
case 'SEDANG':
|
||||
return Colors.orange;
|
||||
case 'RENDAH':
|
||||
return Colors.green;
|
||||
default:
|
||||
return Colors.grey;
|
||||
}
|
||||
}
|
||||
|
||||
void showFullScreenImage(BuildContext context, String imageUrl) {
|
||||
// Buat controller untuk InteractiveViewer
|
||||
final TransformationController transformationController =
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:penyaluran_app/app/modules/warga/controllers/warga_dashboard_controller.dart';
|
||||
import 'package:penyaluran_app/app/widgets/bantuan_card.dart';
|
||||
import 'package:penyaluran_app/app/theme/app_theme.dart';
|
||||
|
||||
class WargaPenerimaanView extends GetView<WargaDashboardController> {
|
||||
const WargaPenerimaanView({super.key});
|
||||
@ -23,15 +24,6 @@ class WargaPenerimaanView extends GetView<WargaDashboardController> {
|
||||
: _buildPenerimaanList(),
|
||||
);
|
||||
}),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: () {
|
||||
// Navigasi ke halaman riwayat penerimaan
|
||||
Get.toNamed('/riwayat-penyaluran');
|
||||
},
|
||||
backgroundColor: Colors.blue,
|
||||
tooltip: 'Riwayat Penerimaan',
|
||||
child: const Icon(Icons.history),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@ -43,13 +35,13 @@ class WargaPenerimaanView extends GetView<WargaDashboardController> {
|
||||
Container(
|
||||
padding: const EdgeInsets.all(20),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.blue.withOpacity(0.1),
|
||||
color: AppTheme.primaryColor.withOpacity(0.1),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: Icon(
|
||||
Icons.volunteer_activism,
|
||||
size: 80,
|
||||
color: Colors.blue.shade400,
|
||||
color: AppTheme.primaryColor,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
@ -82,6 +74,8 @@ class WargaPenerimaanView extends GetView<WargaDashboardController> {
|
||||
label: const Text('Muat Ulang'),
|
||||
style: ElevatedButton.styleFrom(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12),
|
||||
backgroundColor: AppTheme.primaryColor,
|
||||
foregroundColor: Colors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
|
@ -30,13 +30,13 @@ class WargaPengaduanView extends GetView<WargaDashboardController> {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(
|
||||
Icons.report_problem,
|
||||
Icons.check_circle_outline,
|
||||
size: 80,
|
||||
color: Colors.grey.shade400,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
'Belum Ada Pengaduan',
|
||||
'Bagus!',
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
@ -45,27 +45,12 @@ class WargaPengaduanView extends GetView<WargaDashboardController> {
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
'Anda belum membuat pengaduan',
|
||||
'Belum ada pengaduan yang dibuat',
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Colors.grey.shade600,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
ElevatedButton.icon(
|
||||
onPressed: () {
|
||||
// TODO: Implementasi navigasi ke halaman buat pengaduan
|
||||
Get.toNamed('/buat-pengaduan');
|
||||
},
|
||||
icon: const Icon(Icons.add),
|
||||
label: const Text('Buat Pengaduan Baru'),
|
||||
style: ElevatedButton.styleFrom(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 24,
|
||||
vertical: 12,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
@ -108,16 +108,6 @@ class WargaView extends GetView<WargaDashboardController> {
|
||||
badgeColor: Colors.orange,
|
||||
onTap: () => controller.changeTab(2),
|
||||
),
|
||||
DrawerMenuItem(
|
||||
icon: Icons.assignment_outlined,
|
||||
title: 'Pengajuan Kelayakan',
|
||||
onTap: () {
|
||||
// TODO: Navigasi ke halaman pengajuan kelayakan
|
||||
Get.toNamed('/pengajuan-kelayakan');
|
||||
},
|
||||
badgeCount: controller.totalPengajuanMenunggu.value,
|
||||
badgeColor: Colors.blue,
|
||||
),
|
||||
],
|
||||
)),
|
||||
body: Obx(() {
|
||||
@ -161,20 +151,6 @@ class WargaView extends GetView<WargaDashboardController> {
|
||||
),
|
||||
],
|
||||
)),
|
||||
floatingActionButton: Obx(() {
|
||||
// Tampilkan FAB hanya di halaman pengaduan
|
||||
if (controller.activeTabIndex.value == 2) {
|
||||
return FloatingActionButton(
|
||||
onPressed: () {
|
||||
// TODO: Implementasi navigasi ke halaman buat pengaduan
|
||||
Get.toNamed('/buat-pengaduan');
|
||||
},
|
||||
backgroundColor: AppTheme.primaryColor,
|
||||
child: const Icon(Icons.add),
|
||||
);
|
||||
}
|
||||
return const SizedBox.shrink();
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user