Perbarui tampilan CalendarViewWidget dengan menambahkan padding dan memperbaiki pengaturan gaya untuk meningkatkan pengalaman pengguna. Sederhanakan struktur tampilan di PenyaluranView dengan menghapus elemen yang tidak perlu dan langsung menampilkan CalendarViewWidget.
This commit is contained in:
@ -3,15 +3,12 @@ import 'package:get/get.dart';
|
||||
import 'package:penyaluran_app/app/data/models/penerima_penyaluran_model.dart';
|
||||
import 'package:penyaluran_app/app/modules/penyaluran/detail_penyaluran_controller.dart';
|
||||
import 'package:penyaluran_app/app/theme/app_theme.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import 'package:penyaluran_app/app/modules/penyaluran/konfirmasi_penerima_page.dart';
|
||||
import 'package:penyaluran_app/app/utils/date_formatter.dart';
|
||||
import 'package:penyaluran_app/app/data/models/penyaluran_bantuan_model.dart';
|
||||
import 'package:penyaluran_app/app/utils/date_time_helper.dart';
|
||||
import 'package:flutter_staggered_animations/flutter_staggered_animations.dart';
|
||||
|
||||
class DetailPenyaluranPage extends StatelessWidget {
|
||||
final controller = Get.put(DetailPenyaluranController());
|
||||
final ImagePicker _picker = ImagePicker();
|
||||
final searchController = TextEditingController();
|
||||
final RxString searchQuery = ''.obs;
|
||||
final RxString statusFilter = 'SEMUA'.obs;
|
||||
@ -65,16 +62,14 @@ class DetailPenyaluranPage extends StatelessWidget {
|
||||
children: [
|
||||
_buildInfoCard(context),
|
||||
const SizedBox(height: 16),
|
||||
_buildPenerimaPenyaluranSection(context),
|
||||
const SizedBox(height: 24),
|
||||
// Menampilkan section alasan pembatalan jika status BATALTERLAKSANA
|
||||
if (controller.penyaluran.value?.status?.toUpperCase() ==
|
||||
'BATALTERLAKSANA' &&
|
||||
controller.penyaluran.value?.alasanPembatalan != null &&
|
||||
controller.penyaluran.value!.alasanPembatalan!.isNotEmpty)
|
||||
_buildPembatalanSection(context),
|
||||
const SizedBox(height: 16),
|
||||
_buildPenerimaPenyaluranSection(context),
|
||||
const SizedBox(height: 24),
|
||||
// Tombol aksi akan ditampilkan di bottomNavigationBar
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -161,7 +156,7 @@ class DetailPenyaluranPage extends StatelessWidget {
|
||||
_buildInfoRow(
|
||||
'Tanggal',
|
||||
penyaluran.tanggalPenyaluran != null
|
||||
? DateFormatter.formatDateTime(
|
||||
? DateTimeHelper.formatDateTime(
|
||||
penyaluran.tanggalPenyaluran!)
|
||||
: 'Belum dijadwalkan'),
|
||||
// Tampilkan tanggal selesai jika status TERLAKSANA atau BATALTERLAKSANA
|
||||
@ -170,7 +165,8 @@ class DetailPenyaluranPage extends StatelessWidget {
|
||||
_buildInfoRow(
|
||||
'Tanggal Selesai',
|
||||
penyaluran.tanggalSelesai != null
|
||||
? DateFormatter.formatDateTime(penyaluran.tanggalSelesai!)
|
||||
? DateTimeHelper.formatDateTime(
|
||||
penyaluran.tanggalSelesai!)
|
||||
: '-'),
|
||||
_buildInfoRow(
|
||||
'Jumlah Penerima', '${penyaluran.jumlahPenerima ?? 0} orang'),
|
||||
@ -201,72 +197,6 @@ class DetailPenyaluranPage extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
// Alasan penolakan jika ada
|
||||
if (penyaluran.alasanPembatalan != null &&
|
||||
penyaluran.alasanPembatalan!.isNotEmpty) ...[
|
||||
const Divider(height: 24),
|
||||
if (penyaluran.status?.toUpperCase() == 'BATALTERLAKSANA') ...[
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: AppTheme.errorColor.withOpacity(0.1),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(
|
||||
color: AppTheme.errorColor.withOpacity(0.5),
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.cancel_outlined,
|
||||
color: AppTheme.errorColor,
|
||||
size: 20,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
'Alasan Pembatalan:',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: AppTheme.errorColor,
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
penyaluran.alasanPembatalan!,
|
||||
style: TextStyle(
|
||||
color: Colors.red[700],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
] else ...[
|
||||
Text(
|
||||
'Alasan Pembatalan:',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.red[700],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
penyaluran.alasanPembatalan!,
|
||||
style: TextStyle(
|
||||
color: Colors.red[700],
|
||||
fontStyle: FontStyle.italic,
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -1339,7 +1269,7 @@ class DetailPenyaluranPage extends StatelessWidget {
|
||||
if (penerima.tanggalPenerimaan != null)
|
||||
_buildInfoRow(
|
||||
'Tanggal Penerimaan',
|
||||
DateFormatter.formatDate(
|
||||
DateTimeHelper.formatDate(
|
||||
penerima.tanggalPenerimaan!)),
|
||||
if (penerima.jumlahBantuan != null)
|
||||
_buildInfoRow('Jumlah Bantuan',
|
||||
@ -1440,26 +1370,25 @@ class DetailPenyaluranPage extends StatelessWidget {
|
||||
|
||||
// Tombol tutup
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
child: ElevatedButton(
|
||||
onPressed: () => Navigator.pop(context),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.grey.shade200,
|
||||
foregroundColor: Colors.black87,
|
||||
padding: const EdgeInsets.symmetric(vertical: 12),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
width: double.infinity,
|
||||
child: ElevatedButton(
|
||||
onPressed: () => Navigator.pop(context),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.grey.shade200,
|
||||
foregroundColor: Colors.black87,
|
||||
padding: const EdgeInsets.symmetric(vertical: 12),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
),
|
||||
),
|
||||
child: const Text(
|
||||
'Tutup',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
child: const Text(
|
||||
'Tutup',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -1532,7 +1461,7 @@ class DetailPenyaluranPage extends StatelessWidget {
|
||||
_buildInfoRow('Status', 'Batal Terlaksana'),
|
||||
if (penyaluran.tanggalSelesai != null)
|
||||
_buildInfoRow('Tanggal Pembatalan',
|
||||
DateFormatter.formatDateTime(penyaluran.tanggalSelesai!)),
|
||||
DateTimeHelper.formatDateTime(penyaluran.tanggalSelesai!)),
|
||||
const SizedBox(height: 8),
|
||||
const Text(
|
||||
'Alasan Pembatalan:',
|
||||
|
@ -9,7 +9,7 @@ import 'package:signature/signature.dart';
|
||||
import 'dart:io';
|
||||
import 'dart:typed_data';
|
||||
import 'dart:ui' as ui;
|
||||
import 'package:penyaluran_app/app/utils/date_formatter.dart';
|
||||
import 'package:penyaluran_app/app/utils/date_time_helper.dart';
|
||||
|
||||
class KonfirmasiPenerimaPage extends StatefulWidget {
|
||||
final PenerimaPenyaluranModel penerima;
|
||||
@ -187,7 +187,7 @@ class _KonfirmasiPenerimaPageState extends State<KonfirmasiPenerimaPage> {
|
||||
'Tempat, Tanggal Lahir',
|
||||
warga?['tempat_lahir'] != null &&
|
||||
warga?['tanggal_lahir'] != null
|
||||
? '${warga!['tempat_lahir']}, ${DateFormatter.formatDate(DateTime.parse(warga['tanggal_lahir']), format: 'd MMMM yyyy')}'
|
||||
? '${warga!['tempat_lahir']}, ${DateTimeHelper.formatDate(DateTime.parse(warga['tanggal_lahir']), format: 'd MMMM yyyy')}'
|
||||
: 'Bogor, 2 Juni 1990'),
|
||||
const Divider(),
|
||||
|
||||
@ -223,9 +223,9 @@ class _KonfirmasiPenerimaPageState extends State<KonfirmasiPenerimaPage> {
|
||||
|
||||
String tanggalWaktuPenyaluran = '';
|
||||
if (widget.tanggalPenyaluran != null) {
|
||||
final tanggal = DateFormatter.formatDate(widget.tanggalPenyaluran!);
|
||||
final waktuMulai = DateFormatter.formatTime(widget.tanggalPenyaluran!);
|
||||
final waktuSelesai = DateFormatter.formatTime(
|
||||
final tanggal = DateTimeHelper.formatDate(widget.tanggalPenyaluran!);
|
||||
final waktuMulai = DateTimeHelper.formatTime(widget.tanggalPenyaluran!);
|
||||
final waktuSelesai = DateTimeHelper.formatTime(
|
||||
widget.tanggalPenyaluran!.add(const Duration(hours: 1)));
|
||||
tanggalWaktuPenyaluran = '$tanggal $waktuMulai-$waktuSelesai';
|
||||
} else {
|
||||
|
@ -42,86 +42,90 @@ class CalendarViewWidget extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: MediaQuery.of(context).size.height * 0.65,
|
||||
child: Obx(() {
|
||||
return SfCalendar(
|
||||
view: CalendarView.month,
|
||||
dataSource: _getCalendarDataSource(),
|
||||
timeZone: 'Asia/Jakarta',
|
||||
monthViewSettings: MonthViewSettings(
|
||||
appointmentDisplayMode: MonthAppointmentDisplayMode.indicator,
|
||||
showAgenda: true,
|
||||
agendaViewHeight: MediaQuery.of(context).size.height * 0.3,
|
||||
agendaItemHeight: 60,
|
||||
dayFormat: 'EEE',
|
||||
numberOfWeeksInView: 6,
|
||||
appointmentDisplayCount: 3,
|
||||
monthCellStyle: MonthCellStyle(
|
||||
textStyle: const TextStyle(
|
||||
fontSize: 12,
|
||||
color: Colors.black87,
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: SizedBox(
|
||||
height: MediaQuery.of(context).size.height * 0.65,
|
||||
child: Obx(() {
|
||||
return SfCalendar(
|
||||
view: CalendarView.month,
|
||||
dataSource: _getCalendarDataSource(),
|
||||
timeZone: 'Asia/Jakarta',
|
||||
monthViewSettings: MonthViewSettings(
|
||||
appointmentDisplayMode:
|
||||
MonthAppointmentDisplayMode.indicator,
|
||||
showAgenda: true,
|
||||
agendaViewHeight: MediaQuery.of(context).size.height * 0.3,
|
||||
agendaItemHeight: 60,
|
||||
dayFormat: 'EEE',
|
||||
numberOfWeeksInView: 6,
|
||||
appointmentDisplayCount: 3,
|
||||
monthCellStyle: MonthCellStyle(
|
||||
textStyle: const TextStyle(
|
||||
fontSize: 12,
|
||||
color: Colors.black87,
|
||||
),
|
||||
trailingDatesTextStyle: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Colors.grey.withOpacity(0.7),
|
||||
),
|
||||
leadingDatesTextStyle: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Colors.grey.withOpacity(0.7),
|
||||
),
|
||||
),
|
||||
trailingDatesTextStyle: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Colors.grey.withOpacity(0.7),
|
||||
),
|
||||
leadingDatesTextStyle: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Colors.grey.withOpacity(0.7),
|
||||
agendaStyle: const AgendaStyle(
|
||||
backgroundColor: Colors.white,
|
||||
appointmentTextStyle: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Colors.white,
|
||||
),
|
||||
dateTextStyle: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: AppTheme.primaryColor,
|
||||
),
|
||||
dayTextStyle: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: AppTheme.primaryColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
agendaStyle: const AgendaStyle(
|
||||
cellBorderColor: Colors.grey.withOpacity(0.2),
|
||||
todayHighlightColor: AppTheme.primaryColor,
|
||||
selectionDecoration: BoxDecoration(
|
||||
color: Colors.transparent,
|
||||
border: Border.all(color: AppTheme.primaryColor, width: 2),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(4)),
|
||||
shape: BoxShape.rectangle,
|
||||
),
|
||||
headerStyle: const CalendarHeaderStyle(
|
||||
backgroundColor: Colors.white,
|
||||
appointmentTextStyle: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Colors.white,
|
||||
),
|
||||
dateTextStyle: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: AppTheme.primaryColor,
|
||||
),
|
||||
dayTextStyle: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
textStyle: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: AppTheme.primaryColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
cellBorderColor: Colors.grey.withOpacity(0.2),
|
||||
todayHighlightColor: AppTheme.primaryColor,
|
||||
selectionDecoration: BoxDecoration(
|
||||
color: Colors.transparent,
|
||||
border: Border.all(color: AppTheme.primaryColor, width: 2),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(4)),
|
||||
shape: BoxShape.rectangle,
|
||||
),
|
||||
headerStyle: const CalendarHeaderStyle(
|
||||
backgroundColor: Colors.white,
|
||||
textStyle: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: AppTheme.primaryColor,
|
||||
),
|
||||
),
|
||||
monthCellBuilder: _monthCellBuilder,
|
||||
onTap: (CalendarTapDetails details) {
|
||||
if (details.targetElement == CalendarElement.appointment) {
|
||||
final Appointment appointment = details.appointments![0];
|
||||
_showAppointmentDetails(context, appointment);
|
||||
} else if (details.targetElement ==
|
||||
CalendarElement.calendarCell) {
|
||||
// if (appointmentsOnDay.isNotEmpty) {
|
||||
// _showAppointmentsOnDay(
|
||||
// context, details.date!, appointmentsOnDay);
|
||||
// }
|
||||
}
|
||||
},
|
||||
appointmentBuilder: _appointmentBuilder,
|
||||
);
|
||||
}),
|
||||
monthCellBuilder: _monthCellBuilder,
|
||||
onTap: (CalendarTapDetails details) {
|
||||
if (details.targetElement == CalendarElement.appointment) {
|
||||
final Appointment appointment = details.appointments![0];
|
||||
_showAppointmentDetails(context, appointment);
|
||||
} else if (details.targetElement ==
|
||||
CalendarElement.calendarCell) {
|
||||
// if (appointmentsOnDay.isNotEmpty) {
|
||||
// _showAppointmentsOnDay(
|
||||
// context, details.date!, appointmentsOnDay);
|
||||
// }
|
||||
}
|
||||
},
|
||||
appointmentBuilder: _appointmentBuilder,
|
||||
);
|
||||
}),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -1,6 +1,6 @@
|
||||
import 'package:get/get.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:penyaluran_app/app/utils/date_formatter.dart';
|
||||
import 'package:penyaluran_app/app/utils/date_time_helper.dart';
|
||||
|
||||
class PenerimaController extends GetxController {
|
||||
final RxList<Map<String, dynamic>> daftarPenerima =
|
||||
@ -190,7 +190,7 @@ class PenerimaController extends GetxController {
|
||||
);
|
||||
|
||||
if (picked != null) {
|
||||
tanggalPenyaluran.value = DateFormatter.formatDate(picked);
|
||||
tanggalPenyaluran.value = DateTimeHelper.formatDate(picked);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,7 @@ import 'package:penyaluran_app/app/theme/app_theme.dart';
|
||||
import 'package:penyaluran_app/app/data/models/donatur_model.dart';
|
||||
import 'package:penyaluran_app/app/data/models/penitipan_bantuan_model.dart';
|
||||
import 'package:penyaluran_app/app/widgets/detail_penitipan_dialog.dart';
|
||||
import 'package:penyaluran_app/app/utils/date_formatter.dart';
|
||||
import 'package:penyaluran_app/app/utils/date_time_helper.dart';
|
||||
|
||||
class DetailDonaturView extends GetView<DonaturController> {
|
||||
const DetailDonaturView({super.key});
|
||||
@ -207,7 +207,7 @@ class DetailDonaturView extends GetView<DonaturController> {
|
||||
Icons.calendar_today,
|
||||
'Terdaftar Sejak',
|
||||
donatur.createdAt != null
|
||||
? DateFormatter.formatDate(donatur.createdAt!)
|
||||
? DateTimeHelper.formatDate(donatur.createdAt!)
|
||||
: 'Tidak diketahui',
|
||||
),
|
||||
],
|
||||
@ -433,7 +433,7 @@ class DetailDonaturView extends GetView<DonaturController> {
|
||||
Widget _buildDonasiItem(PenitipanBantuanModel penitipan) {
|
||||
final isUang = penitipan.isUang == true;
|
||||
final tanggal = penitipan.createdAt != null
|
||||
? DateFormatter.formatDate(penitipan.createdAt!, format: 'dd MMM yyyy')
|
||||
? DateTimeHelper.formatDate(penitipan.createdAt!, format: 'dd MMM yyyy')
|
||||
: 'Tanggal tidak diketahui';
|
||||
|
||||
String nilaiDonasi = '';
|
||||
|
@ -55,7 +55,7 @@ class DetailPenerimaView extends GetView<PenerimaController> {
|
||||
],
|
||||
),
|
||||
),
|
||||
bottomNavigationBar: _buildBottomButtons(penerima),
|
||||
// bottomNavigationBar: _buildBottomButtons(penerima),
|
||||
);
|
||||
});
|
||||
}
|
||||
@ -345,84 +345,4 @@ class DetailPenerimaView extends GetView<PenerimaController> {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildBottomButtons(Map<String, dynamic> penerima) {
|
||||
// Jika status sudah selesai, tidak perlu menampilkan tombol
|
||||
if (penerima['status'] == 'Selesai') {
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: ElevatedButton.icon(
|
||||
onPressed: () {
|
||||
// Implementasi lihat riwayat penyaluran
|
||||
},
|
||||
icon: const Icon(Icons.history),
|
||||
label: const Text('Lihat Riwayat Penyaluran'),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: AppTheme.primaryColor,
|
||||
foregroundColor: Colors.white,
|
||||
padding: const EdgeInsets.symmetric(vertical: 12),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// Jika status belum disalurkan, tampilkan tombol jadwalkan
|
||||
if (penerima['status'] == 'Belum disalurkan') {
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: ElevatedButton.icon(
|
||||
onPressed: () {
|
||||
// Implementasi jadwalkan penyaluran
|
||||
},
|
||||
icon: const Icon(Icons.event),
|
||||
label: const Text('Jadwalkan Penyaluran'),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: AppTheme.primaryColor,
|
||||
foregroundColor: Colors.white,
|
||||
padding: const EdgeInsets.symmetric(vertical: 12),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// Jika status terjadwal, tampilkan tombol konfirmasi penyaluran
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: ElevatedButton.icon(
|
||||
onPressed: () {
|
||||
// Navigasi ke halaman konfirmasi penerima
|
||||
Get.toNamed('/daftar-penerima/konfirmasi',
|
||||
arguments: penerima['id']);
|
||||
},
|
||||
icon: const Icon(Icons.check_circle),
|
||||
label: const Text('Konfirmasi Penyaluran'),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: AppTheme.successColor,
|
||||
foregroundColor: Colors.white,
|
||||
padding: const EdgeInsets.symmetric(vertical: 12),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ import 'package:penyaluran_app/app/data/models/donatur_model.dart';
|
||||
import 'package:penyaluran_app/app/data/models/penitipan_bantuan_model.dart';
|
||||
import 'package:penyaluran_app/app/modules/petugas_desa/controllers/penitipan_bantuan_controller.dart';
|
||||
import 'package:penyaluran_app/app/theme/app_theme.dart';
|
||||
import 'package:penyaluran_app/app/utils/date_formatter.dart';
|
||||
import 'package:penyaluran_app/app/utils/date_time_helper.dart';
|
||||
import 'package:penyaluran_app/app/widgets/detail_penitipan_dialog.dart';
|
||||
import 'dart:io';
|
||||
|
||||
@ -78,7 +78,7 @@ class PenitipanView extends GetView<PenitipanBantuanController> {
|
||||
context,
|
||||
icon: Icons.pending_actions,
|
||||
title: 'Menunggu',
|
||||
value: DateFormatter.formatNumber(
|
||||
value: DateTimeHelper.formatNumber(
|
||||
controller.jumlahMenunggu.value),
|
||||
color: Colors.orange,
|
||||
),
|
||||
@ -88,7 +88,7 @@ class PenitipanView extends GetView<PenitipanBantuanController> {
|
||||
context,
|
||||
icon: Icons.check_circle,
|
||||
title: 'Terverifikasi',
|
||||
value: DateFormatter.formatNumber(
|
||||
value: DateTimeHelper.formatNumber(
|
||||
controller.jumlahTerverifikasi.value),
|
||||
color: Colors.green,
|
||||
),
|
||||
@ -98,7 +98,7 @@ class PenitipanView extends GetView<PenitipanBantuanController> {
|
||||
context,
|
||||
icon: Icons.cancel,
|
||||
title: 'Ditolak',
|
||||
value: DateFormatter.formatNumber(
|
||||
value: DateTimeHelper.formatNumber(
|
||||
controller.jumlahDitolak.value),
|
||||
color: Colors.red,
|
||||
),
|
||||
@ -225,7 +225,7 @@ class PenitipanView extends GetView<PenitipanBantuanController> {
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'${DateFormatter.formatNumber(filteredList.length)} item',
|
||||
'${DateTimeHelper.formatNumber(filteredList.length)} item',
|
||||
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
||||
color: Colors.grey,
|
||||
),
|
||||
@ -385,8 +385,8 @@ class PenitipanView extends GetView<PenitipanBantuanController> {
|
||||
isUang ? Icons.account_balance_wallet : Icons.inventory,
|
||||
label: 'Jumlah',
|
||||
value: isUang
|
||||
? 'Rp ${DateFormatter.formatNumber(item.jumlah)}'
|
||||
: '${DateFormatter.formatNumber(item.jumlah)} $kategoriSatuan',
|
||||
? 'Rp ${DateTimeHelper.formatNumber(item.jumlah)}'
|
||||
: '${DateTimeHelper.formatNumber(item.jumlah)} $kategoriSatuan',
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -400,7 +400,7 @@ class PenitipanView extends GetView<PenitipanBantuanController> {
|
||||
context,
|
||||
icon: Icons.calendar_today,
|
||||
label: 'Tanggal Dibuat',
|
||||
value: DateFormatter.formatDateTime(item.createdAt,
|
||||
value: DateTimeHelper.formatDateTime(item.createdAt,
|
||||
defaultValue: 'Tidak ada tanggal'),
|
||||
),
|
||||
),
|
||||
@ -1523,7 +1523,7 @@ class PenitipanView extends GetView<PenitipanBantuanController> {
|
||||
Widget _buildLastUpdateInfo(BuildContext context) {
|
||||
return Obx(() {
|
||||
final lastUpdate = controller.lastUpdateTime.value;
|
||||
final formattedDate = DateFormatter.formatDateTimeWithHour(lastUpdate);
|
||||
final formattedDate = DateTimeHelper.formatDateTimeWithHour(lastUpdate);
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(top: 8.0),
|
||||
|
@ -3,7 +3,6 @@ import 'package:get/get.dart';
|
||||
import 'package:penyaluran_app/app/modules/petugas_desa/controllers/jadwal_penyaluran_controller.dart';
|
||||
import 'package:penyaluran_app/app/theme/app_theme.dart';
|
||||
import 'package:penyaluran_app/app/modules/petugas_desa/components/jadwal_section_widget.dart';
|
||||
import 'package:penyaluran_app/app/modules/petugas_desa/components/permintaan_penjadwalan_summary_widget.dart';
|
||||
import 'package:penyaluran_app/app/modules/petugas_desa/components/calendar_view_widget.dart';
|
||||
import 'package:penyaluran_app/app/modules/petugas_desa/views/tambah_penyaluran_view.dart';
|
||||
|
||||
@ -117,18 +116,7 @@ class PenyaluranView extends GetView<JadwalPenyaluranController> {
|
||||
);
|
||||
}
|
||||
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// Ringkasan jadwal
|
||||
_buildJadwalSummary(Get.context!),
|
||||
|
||||
const SizedBox(height: 20),
|
||||
|
||||
// Kalender Penyaluran Bulan Ini
|
||||
CalendarViewWidget(controller: controller),
|
||||
],
|
||||
);
|
||||
return CalendarViewWidget(controller: controller);
|
||||
}),
|
||||
),
|
||||
),
|
||||
|
@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:penyaluran_app/app/data/models/penitipan_bantuan_model.dart';
|
||||
import 'package:penyaluran_app/app/modules/petugas_desa/controllers/penitipan_bantuan_controller.dart';
|
||||
import 'package:penyaluran_app/app/utils/date_formatter.dart';
|
||||
import 'package:penyaluran_app/app/utils/date_time_helper.dart';
|
||||
import 'package:penyaluran_app/app/theme/app_theme.dart';
|
||||
|
||||
class RiwayatPenitipanView extends GetView<PenitipanBantuanController> {
|
||||
@ -47,7 +47,7 @@ class RiwayatPenitipanView extends GetView<PenitipanBantuanController> {
|
||||
final kategoriNama = item.kategoriBantuan?.nama?.toLowerCase() ?? '';
|
||||
final deskripsi = item.deskripsi?.toLowerCase() ?? '';
|
||||
final tanggal =
|
||||
DateFormatter.formatDateTime(item.tanggalPenitipan).toLowerCase();
|
||||
DateTimeHelper.formatDateTime(item.tanggalPenitipan).toLowerCase();
|
||||
|
||||
return donaturNama.contains(searchText) ||
|
||||
kategoriNama.contains(searchText) ||
|
||||
@ -99,7 +99,7 @@ class RiwayatPenitipanView extends GetView<PenitipanBantuanController> {
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'${DateFormatter.formatNumber(filteredList.length)} item',
|
||||
'${DateTimeHelper.formatNumber(filteredList.length)} item',
|
||||
style:
|
||||
Theme.of(context).textTheme.bodyMedium?.copyWith(
|
||||
color: Colors.grey,
|
||||
@ -113,7 +113,7 @@ class RiwayatPenitipanView extends GetView<PenitipanBantuanController> {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'Total: ${DateFormatter.formatNumber(filteredList.length)} item',
|
||||
'Total: ${DateTimeHelper.formatNumber(filteredList.length)} item',
|
||||
style:
|
||||
Theme.of(context).textTheme.bodyMedium?.copyWith(
|
||||
color: Colors.grey,
|
||||
@ -126,7 +126,7 @@ class RiwayatPenitipanView extends GetView<PenitipanBantuanController> {
|
||||
size: 16, color: Colors.grey[600]),
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
'Update: ${DateFormatter.formatDateTimeWithHour(controller.lastUpdateTime.value)}',
|
||||
'Update: ${DateTimeHelper.formatDateTimeWithHour(controller.lastUpdateTime.value)}',
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Colors.grey[600],
|
||||
@ -284,8 +284,8 @@ class RiwayatPenitipanView extends GetView<PenitipanBantuanController> {
|
||||
isUang ? Icons.account_balance_wallet : Icons.inventory,
|
||||
label: 'Jumlah',
|
||||
value: isUang
|
||||
? 'Rp ${DateFormatter.formatNumber(item.jumlah)}'
|
||||
: '${DateFormatter.formatNumber(item.jumlah)} $kategoriSatuan',
|
||||
? 'Rp ${DateTimeHelper.formatNumber(item.jumlah)}'
|
||||
: '${DateTimeHelper.formatNumber(item.jumlah)} $kategoriSatuan',
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -300,7 +300,7 @@ class RiwayatPenitipanView extends GetView<PenitipanBantuanController> {
|
||||
label: item.status == 'TERVERIFIKASI'
|
||||
? 'Tanggal Verifikasi'
|
||||
: 'Tanggal Penolakan',
|
||||
value: DateFormatter.formatDateTime(
|
||||
value: DateTimeHelper.formatDateTime(
|
||||
item.status == 'TERVERIFIKASI'
|
||||
? item.tanggalVerifikasi
|
||||
: item.updatedAt,
|
||||
@ -414,20 +414,20 @@ class RiwayatPenitipanView extends GetView<PenitipanBantuanController> {
|
||||
_buildDetailItem(
|
||||
'Jumlah',
|
||||
isUang
|
||||
? 'Rp ${DateFormatter.formatNumber(item.jumlah)}'
|
||||
: '${DateFormatter.formatNumber(item.jumlah)} $kategoriSatuan'),
|
||||
? 'Rp ${DateTimeHelper.formatNumber(item.jumlah)}'
|
||||
: '${DateTimeHelper.formatNumber(item.jumlah)} $kategoriSatuan'),
|
||||
if (isUang) _buildDetailItem('Jenis Bantuan', 'Uang (Rupiah)'),
|
||||
_buildDetailItem(
|
||||
'Deskripsi', item.deskripsi ?? 'Tidak ada deskripsi'),
|
||||
_buildDetailItem(
|
||||
'Tanggal Penitipan',
|
||||
DateFormatter.formatDateTime(item.tanggalPenitipan,
|
||||
DateTimeHelper.formatDateTime(item.tanggalPenitipan,
|
||||
defaultValue: 'Tidak ada tanggal'),
|
||||
),
|
||||
if (item.tanggalVerifikasi != null)
|
||||
_buildDetailItem(
|
||||
'Tanggal Verifikasi',
|
||||
DateFormatter.formatDateTime(item.tanggalVerifikasi),
|
||||
DateTimeHelper.formatDateTime(item.tanggalVerifikasi),
|
||||
),
|
||||
if (item.status == 'TERVERIFIKASI' && item.petugasDesaId != null)
|
||||
_buildDetailItem(
|
||||
@ -435,7 +435,7 @@ class RiwayatPenitipanView extends GetView<PenitipanBantuanController> {
|
||||
controller.getPetugasDesaNama(item.petugasDesaId),
|
||||
),
|
||||
_buildDetailItem('Tanggal Dibuat',
|
||||
DateFormatter.formatDateTime(item.createdAt)),
|
||||
DateTimeHelper.formatDateTime(item.createdAt)),
|
||||
if (item.alasanPenolakan != null &&
|
||||
item.alasanPenolakan!.isNotEmpty)
|
||||
_buildDetailItem('Alasan Penolakan', item.alasanPenolakan!),
|
||||
|
@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:penyaluran_app/app/data/models/penyaluran_bantuan_model.dart';
|
||||
import 'package:penyaluran_app/app/modules/petugas_desa/controllers/jadwal_penyaluran_controller.dart';
|
||||
import 'package:penyaluran_app/app/utils/date_formatter.dart';
|
||||
import 'package:penyaluran_app/app/utils/date_time_helper.dart';
|
||||
import 'package:penyaluran_app/app/theme/app_theme.dart';
|
||||
|
||||
class RiwayatPenyaluranView extends GetView<JadwalPenyaluranController> {
|
||||
@ -52,7 +52,7 @@ class RiwayatPenyaluranView extends GetView<JadwalPenyaluranController> {
|
||||
.getKategoriBantuanName(item.kategoriBantuanId)
|
||||
.toLowerCase();
|
||||
final tanggal =
|
||||
DateFormatter.formatDateTime(item.tanggalPenyaluran).toLowerCase();
|
||||
DateTimeHelper.formatDateTime(item.tanggalPenyaluran).toLowerCase();
|
||||
|
||||
return nama.contains(searchText) ||
|
||||
deskripsi.contains(searchText) ||
|
||||
@ -105,7 +105,7 @@ class RiwayatPenyaluranView extends GetView<JadwalPenyaluranController> {
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'${DateFormatter.formatNumber(filteredList.length)} item',
|
||||
'${DateTimeHelper.formatNumber(filteredList.length)} item',
|
||||
style:
|
||||
Theme.of(context).textTheme.bodyMedium?.copyWith(
|
||||
color: Colors.grey,
|
||||
@ -119,7 +119,7 @@ class RiwayatPenyaluranView extends GetView<JadwalPenyaluranController> {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'Total: ${DateFormatter.formatNumber(filteredList.length)} item',
|
||||
'Total: ${DateTimeHelper.formatNumber(filteredList.length)} item',
|
||||
style:
|
||||
Theme.of(context).textTheme.bodyMedium?.copyWith(
|
||||
color: Colors.grey,
|
||||
@ -132,7 +132,7 @@ class RiwayatPenyaluranView extends GetView<JadwalPenyaluranController> {
|
||||
size: 16, color: Colors.grey[600]),
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
'Update: ${DateFormatter.formatDateTimeWithHour(DateTime.now())}',
|
||||
'Update: ${DateTimeHelper.formatDateTimeWithHour(DateTime.now())}',
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Colors.grey[600],
|
||||
@ -305,8 +305,8 @@ class RiwayatPenyaluranView extends GetView<JadwalPenyaluranController> {
|
||||
child: _buildInfoItem(
|
||||
Icons.event,
|
||||
'Tanggal',
|
||||
DateFormatter.formatDateTime(item.tanggalPenyaluran,
|
||||
defaultValue: 'Tidak ada tanggal'),
|
||||
DateTimeHelper.formatDateTime(item.tanggalPenyaluran,
|
||||
format: 'dd MMM yyyy HH:mm'),
|
||||
Theme.of(context).textTheme,
|
||||
),
|
||||
),
|
||||
@ -316,7 +316,7 @@ class RiwayatPenyaluranView extends GetView<JadwalPenyaluranController> {
|
||||
_buildInfoItem(
|
||||
Icons.people_outline,
|
||||
'Jumlah Penerima',
|
||||
'${DateFormatter.formatNumber(item.jumlahPenerima ?? 0)} orang',
|
||||
'${DateTimeHelper.formatNumber(item.jumlahPenerima ?? 0)} orang',
|
||||
Theme.of(context).textTheme,
|
||||
),
|
||||
if (item.alasanPembatalan != null &&
|
||||
|
@ -3,7 +3,7 @@ import 'package:get/get.dart';
|
||||
import 'package:penyaluran_app/app/data/models/stok_bantuan_model.dart';
|
||||
import 'package:penyaluran_app/app/modules/petugas_desa/controllers/stok_bantuan_controller.dart';
|
||||
import 'package:penyaluran_app/app/theme/app_theme.dart';
|
||||
import 'package:penyaluran_app/app/utils/date_formatter.dart';
|
||||
import 'package:penyaluran_app/app/utils/date_time_helper.dart';
|
||||
|
||||
class StokBantuanView extends GetView<StokBantuanController> {
|
||||
const StokBantuanView({super.key});
|
||||
@ -154,7 +154,7 @@ class StokBantuanView extends GetView<StokBantuanController> {
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'Rp ${DateFormatter.formatNumber(controller.totalDanaBantuan.value)}',
|
||||
'Rp ${DateTimeHelper.formatNumber(controller.totalDanaBantuan.value)}',
|
||||
style:
|
||||
Theme.of(context).textTheme.titleLarge?.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
@ -417,8 +417,8 @@ class StokBantuanView extends GetView<StokBantuanController> {
|
||||
: Icons.inventory,
|
||||
label: item.isUang == true ? 'Total Dana' : 'Total Stok',
|
||||
value: item.isUang == true
|
||||
? 'Rp ${DateFormatter.formatNumber(item.totalStok)}'
|
||||
: '${DateFormatter.formatNumber(item.totalStok)} ${item.satuan ?? ''}',
|
||||
? 'Rp ${DateTimeHelper.formatNumber(item.totalStok)}'
|
||||
: '${DateTimeHelper.formatNumber(item.totalStok)} ${item.satuan ?? ''}',
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
@ -426,7 +426,7 @@ class StokBantuanView extends GetView<StokBantuanController> {
|
||||
context,
|
||||
icon: Icons.access_time,
|
||||
label: 'Terakhir Diperbarui',
|
||||
value: DateFormatter.formatDateTime(item.updatedAt),
|
||||
value: DateTimeHelper.formatDateTime(item.updatedAt),
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -873,8 +873,8 @@ class StokBantuanView extends GetView<StokBantuanController> {
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
isUang
|
||||
? 'Rp ${DateFormatter.formatNumber(stok.totalStok)}'
|
||||
: '${DateFormatter.formatNumber(stok.totalStok)} ${stok.satuan ?? ''}',
|
||||
? 'Rp ${DateTimeHelper.formatNumber(stok.totalStok)}'
|
||||
: '${DateTimeHelper.formatNumber(stok.totalStok)} ${stok.satuan ?? ''}',
|
||||
style: TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
],
|
||||
@ -1064,8 +1064,8 @@ class StokBantuanView extends GetView<StokBantuanController> {
|
||||
SizedBox(width: 4),
|
||||
Text(
|
||||
stok.isUang == true
|
||||
? 'Rp ${DateFormatter.formatNumber(stok.totalStok)}'
|
||||
: '${DateFormatter.formatNumber(stok.totalStok)} ${stok.satuan ?? ''}',
|
||||
? 'Rp ${DateTimeHelper.formatNumber(stok.totalStok)}'
|
||||
: '${DateTimeHelper.formatNumber(stok.totalStok)} ${stok.satuan ?? ''}',
|
||||
style: TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
],
|
||||
@ -1129,7 +1129,7 @@ class StokBantuanView extends GetView<StokBantuanController> {
|
||||
Widget _buildLastUpdateInfo(BuildContext context) {
|
||||
return Obx(() {
|
||||
final lastUpdate = controller.lastUpdateTime.value;
|
||||
final formattedDate = DateFormatter.formatDateTimeWithHour(lastUpdate);
|
||||
final formattedDate = DateTimeHelper.formatDateTimeWithHour(lastUpdate);
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(top: 8.0),
|
||||
|
@ -3,7 +3,7 @@ import 'package:get/get.dart';
|
||||
import 'package:penyaluran_app/app/modules/petugas_desa/controllers/jadwal_penyaluran_controller.dart';
|
||||
import 'package:penyaluran_app/app/theme/app_theme.dart';
|
||||
import 'package:penyaluran_app/app/data/models/skema_bantuan_model.dart';
|
||||
import 'package:penyaluran_app/app/utils/date_formatter.dart';
|
||||
import 'package:penyaluran_app/app/utils/date_time_helper.dart';
|
||||
|
||||
class TambahPenyaluranView extends GetView<JadwalPenyaluranController> {
|
||||
const TambahPenyaluranView({super.key});
|
||||
@ -327,7 +327,7 @@ class TambahPenyaluranView extends GetView<JadwalPenyaluranController> {
|
||||
if (pickedDate != null) {
|
||||
selectedDate.value = pickedDate;
|
||||
tanggalPenyaluranController.text =
|
||||
DateFormatter.formatDate(pickedDate);
|
||||
DateTimeHelper.formatDate(pickedDate);
|
||||
}
|
||||
},
|
||||
validator: (value) {
|
||||
|
Reference in New Issue
Block a user