Perbarui model dan tampilan untuk mendukung perubahan struktur data pengguna. Ganti properti nama dan telepon dengan namaLengkap dan noHp di beberapa model, termasuk DonaturModel, PetugasDesaModel, dan WargaModel. Modifikasi tampilan dan controller untuk menggunakan properti baru ini. Tambahkan fungsionalitas baru untuk menampilkan nama lengkap dan nomor telepon dengan lebih baik di berbagai tampilan. Perbarui rute dan logika aplikasi untuk mencerminkan perubahan ini.
This commit is contained in:
@ -198,7 +198,7 @@ class DetailDonaturView extends GetView<DonaturController> {
|
||||
donatur.alamat ?? 'Tidak ada alamat'),
|
||||
const SizedBox(height: 8),
|
||||
_buildInfoItem(Icons.phone, 'Telepon',
|
||||
donatur.telepon ?? 'Tidak ada telepon'),
|
||||
donatur.noHp ?? 'Tidak ada telepon'),
|
||||
const SizedBox(height: 8),
|
||||
_buildInfoItem(
|
||||
Icons.email, 'Email', donatur.email ?? 'Tidak ada email'),
|
||||
|
@ -1223,8 +1223,11 @@ class DetailPenyaluranPage extends StatelessWidget {
|
||||
const Divider(height: 24),
|
||||
if (warga != null) ...[
|
||||
_buildInfoRow('NIK', warga['nik'] ?? '-'),
|
||||
_buildInfoRow('Alamat Lengkap',
|
||||
'${warga['alamat'] ?? '-'} Desa ${warga['desa'] ?? '-'} Kecamatan ${warga['kecamatan'] ?? '-'} Kabupaten ${warga['kabupaten'] ?? '-'} Provinsi ${warga['provinsi'] ?? '-'}'),
|
||||
_buildInfoRow('Alamat', warga['alamat'] ?? '-'),
|
||||
_buildInfoRow('Desa', warga['desa'] ?? '-'),
|
||||
_buildInfoRow('Kecamatan', warga['kecamatan'] ?? '-'),
|
||||
_buildInfoRow('Kabupaten', warga['kabupaten'] ?? '-'),
|
||||
_buildInfoRow('Provinsi', warga['provinsi'] ?? '-'),
|
||||
_buildInfoRow(
|
||||
'Jenis Kelamin', warga['jenis_kelamin'] ?? '-'),
|
||||
_buildInfoRow('No. Telepon', warga['no_hp'] ?? '-'),
|
||||
|
@ -918,9 +918,8 @@ class PenitipanView extends GetView<PenitipanBantuanController> {
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
if (selectedDonatur.value!.telepon !=
|
||||
null)
|
||||
Text(selectedDonatur.value!.telepon!),
|
||||
if (selectedDonatur.value!.noHp != null)
|
||||
Text(selectedDonatur.value!.noHp!),
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -984,9 +983,9 @@ class PenitipanView extends GetView<PenitipanBantuanController> {
|
||||
return ListTile(
|
||||
title:
|
||||
Text(donatur.nama ?? 'Tidak ada nama'),
|
||||
subtitle: donatur.telepon != null
|
||||
? Text(donatur.telepon!)
|
||||
: null,
|
||||
subtitle: donatur.noHp != null
|
||||
? Text(donatur.noHp!)
|
||||
: const Text('Tidak ada nomor telepon'),
|
||||
dense: true,
|
||||
onTap: () {
|
||||
selectedDonatur.value = donatur;
|
||||
@ -1300,7 +1299,7 @@ class PenitipanView extends GetView<PenitipanBantuanController> {
|
||||
BuildContext context, Function(String) onDonaturAdded) {
|
||||
final formKey = GlobalKey<FormState>();
|
||||
final TextEditingController namaController = TextEditingController();
|
||||
final TextEditingController teleponController = TextEditingController();
|
||||
final TextEditingController noHpController = TextEditingController();
|
||||
final TextEditingController alamatController = TextEditingController();
|
||||
final TextEditingController emailController = TextEditingController();
|
||||
final TextEditingController jenisController = TextEditingController();
|
||||
@ -1352,24 +1351,24 @@ class PenitipanView extends GetView<PenitipanBantuanController> {
|
||||
|
||||
// Telepon
|
||||
Text(
|
||||
'Nomor Telepon',
|
||||
'Nomor HP',
|
||||
style: Theme.of(context).textTheme.titleSmall,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
TextFormField(
|
||||
controller: teleponController,
|
||||
controller: noHpController,
|
||||
keyboardType: TextInputType.phone,
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
hintText: 'Masukkan nomor telepon',
|
||||
hintText: 'Masukkan nomor HP',
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
horizontal: 12, vertical: 8),
|
||||
),
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return 'Nomor telepon harus diisi';
|
||||
return 'Nomor HP harus diisi';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
@ -1396,24 +1395,16 @@ class PenitipanView extends GetView<PenitipanBantuanController> {
|
||||
: jenisController.text,
|
||||
items: const [
|
||||
DropdownMenuItem<String>(
|
||||
value: 'Perorangan',
|
||||
child: Text('Perorangan'),
|
||||
value: 'Individu',
|
||||
child: Text('Individu'),
|
||||
),
|
||||
DropdownMenuItem<String>(
|
||||
value: 'Perusahaan',
|
||||
child: Text('Perusahaan'),
|
||||
),
|
||||
DropdownMenuItem<String>(
|
||||
value: 'Lembaga',
|
||||
child: Text('Lembaga'),
|
||||
),
|
||||
DropdownMenuItem<String>(
|
||||
value: 'Komunitas',
|
||||
child: Text('Komunitas'),
|
||||
),
|
||||
DropdownMenuItem<String>(
|
||||
value: 'Lainnya',
|
||||
child: Text('Lainnya'),
|
||||
value: 'Organisasi',
|
||||
child: Text('Organisasi'),
|
||||
),
|
||||
],
|
||||
onChanged: (value) {
|
||||
@ -1478,7 +1469,7 @@ class PenitipanView extends GetView<PenitipanBantuanController> {
|
||||
if (formKey.currentState!.validate()) {
|
||||
final donaturId = await controller.tambahDonatur(
|
||||
nama: namaController.text,
|
||||
telepon: teleponController.text,
|
||||
noHp: noHpController.text,
|
||||
alamat: alamatController.text.isEmpty
|
||||
? null
|
||||
: alamatController.text,
|
||||
|
@ -151,7 +151,6 @@ class PetugasDesaView extends GetView<PetugasDesaController> {
|
||||
return const DashboardView();
|
||||
case 1:
|
||||
return const PenyaluranView();
|
||||
|
||||
case 2:
|
||||
return const PenitipanView();
|
||||
case 3:
|
||||
@ -182,22 +181,15 @@ class PetugasDesaView extends GetView<PetugasDesaController> {
|
||||
CircleAvatar(
|
||||
radius: 30,
|
||||
backgroundColor: Colors.white,
|
||||
backgroundImage: controller.user?.avatar != null &&
|
||||
controller.user!.avatar!.isNotEmpty
|
||||
? NetworkImage(controller.user!.avatar!)
|
||||
: null,
|
||||
child: controller.user?.avatar == null ||
|
||||
controller.user!.avatar!.isEmpty
|
||||
? const Icon(
|
||||
Icons.person,
|
||||
size: 40,
|
||||
color: AppTheme.primaryColor,
|
||||
)
|
||||
: null,
|
||||
child: const Icon(
|
||||
Icons.person,
|
||||
size: 40,
|
||||
color: AppTheme.primaryColor,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
controller.user?.name ?? 'Petugas Desa',
|
||||
controller.nama,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18,
|
||||
@ -206,8 +198,8 @@ class PetugasDesaView extends GetView<PetugasDesaController> {
|
||||
),
|
||||
Text(
|
||||
controller.user?.desa?.nama != null
|
||||
? '${controller.user?.role} - ${controller.user!.desa!.nama}'
|
||||
: controller.user?.role ?? 'PETUGAS_DESA',
|
||||
? '${controller.formattedRole} - ${controller.user!.desa!.nama}'
|
||||
: controller.formattedRole,
|
||||
style: TextStyle(
|
||||
color: Colors.white.withAlpha(200),
|
||||
fontSize: 14,
|
||||
@ -251,9 +243,9 @@ class PetugasDesaView extends GetView<PetugasDesaController> {
|
||||
? Badge(
|
||||
label: Text(controller.jumlahDiproses.value.toString()),
|
||||
backgroundColor: Colors.red,
|
||||
child: const Icon(Icons.support_outlined),
|
||||
child: const Icon(Icons.warning_amber_outlined),
|
||||
)
|
||||
: const Icon(Icons.support_outlined),
|
||||
: const Icon(Icons.warning_amber_outlined),
|
||||
title: const Text('Pengaduan'),
|
||||
selected: controller.activeTabIndex.value == 3,
|
||||
selectedColor: AppTheme.primaryColor,
|
||||
@ -272,6 +264,7 @@ class PetugasDesaView extends GetView<PetugasDesaController> {
|
||||
controller.changeTab(4);
|
||||
},
|
||||
),
|
||||
const Divider(),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.person_add_outlined),
|
||||
title: const Text('Kelola Penerima'),
|
||||
@ -296,7 +289,6 @@ class PetugasDesaView extends GetView<PetugasDesaController> {
|
||||
Get.toNamed('/laporan-penyaluran');
|
||||
},
|
||||
),
|
||||
const Divider(),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.person_outline),
|
||||
title: const Text('Profil'),
|
||||
|
@ -310,11 +310,15 @@ class RiwayatPenitipanView extends GetView<PenitipanBantuanController> {
|
||||
if (item.status == 'TERVERIFIKASI' &&
|
||||
item.petugasDesaId != null)
|
||||
Expanded(
|
||||
child: _buildItemDetail(
|
||||
context,
|
||||
icon: Icons.person,
|
||||
label: 'Diverifikasi Oleh',
|
||||
value: controller.getPetugasDesaNama(item.petugasDesaId),
|
||||
child: GetBuilder<PenitipanBantuanController>(
|
||||
id: 'petugas_data',
|
||||
builder: (controller) => _buildItemDetail(
|
||||
context,
|
||||
icon: Icons.person,
|
||||
label: 'Diverifikasi Oleh',
|
||||
value:
|
||||
controller.getPetugasDesaNama(item.petugasDesaId),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
Reference in New Issue
Block a user