membuat tampilan lebih menarik

This commit is contained in:
Khafidh Fuadi
2025-03-27 22:31:14 +07:00
parent f6d3eef2cf
commit c008020705
44 changed files with 6260 additions and 3195 deletions

View File

@ -183,140 +183,294 @@ class DonaturJadwalView extends GetView<DonaturDashboardController> {
statusColor = Colors.blue;
}
return Container(
margin: const EdgeInsets.only(bottom: 12),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.05),
blurRadius: 10,
offset: const Offset(0, 5),
),
],
),
child: Card(
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
return GestureDetector(
onTap: () => _navigateToDetail(jadwal),
child: Container(
margin: const EdgeInsets.only(bottom: 16),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.06),
blurRadius: 12,
offset: const Offset(0, 6),
),
],
),
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 50,
height: 50,
alignment: Alignment.center,
decoration: BoxDecoration(
color: statusColor.withOpacity(0.1),
borderRadius: BorderRadius.circular(10),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
if (jadwal.tanggalPenyaluran != null) ...[
Text(
DateFormat('dd').format(jadwal.tanggalPenyaluran!),
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: statusColor,
),
),
Text(
DateFormat('MMM', 'id_ID')
.format(jadwal.tanggalPenyaluran!)
.toUpperCase(),
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,
color: statusColor,
),
),
] else
Icon(
Icons.event,
color: statusColor,
size: 24,
),
],
),
),
const SizedBox(width: 16),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
jadwal.nama ?? 'Penyaluran Bantuan',
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
child: Card(
elevation: 0,
margin: EdgeInsets.zero,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16),
side: BorderSide(
color: statusColor.withOpacity(0.3),
width: 1.5,
),
),
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Tanggal dalam badge khusus
Container(
width: 58,
height: 65,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12),
boxShadow: [
BoxShadow(
color: statusColor.withOpacity(0.2),
blurRadius: 8,
offset: const Offset(0, 3),
)
],
border: Border.all(
color: statusColor.withOpacity(0.5),
width: 1.5,
),
const SizedBox(height: 4),
Row(
children: [
Icon(
Icons.calendar_today,
size: 14,
color: Colors.grey.shade600,
),
const SizedBox(width: 4),
Text(
formattedDate,
style: TextStyle(
fontSize: 13,
color: Colors.grey.shade700,
),
child: Column(
children: [
// Header badge
Container(
padding: const EdgeInsets.symmetric(vertical: 3),
width: double.infinity,
decoration: BoxDecoration(
color: statusColor,
borderRadius: const BorderRadius.vertical(
top: Radius.circular(10),
),
),
],
),
const SizedBox(height: 8),
Container(
padding: const EdgeInsets.symmetric(
horizontal: 8, vertical: 4),
decoration: BoxDecoration(
color: statusColor.withOpacity(0.1),
borderRadius: BorderRadius.circular(4),
),
child: Text(
statusText,
style: TextStyle(
fontSize: 12,
color: statusColor,
fontWeight: FontWeight.bold,
child: Text(
jadwal.tanggalPenyaluran != null
? DateFormat('MMM', 'id_ID')
.format(jadwal.tanggalPenyaluran!)
.toUpperCase()
: 'TBD',
style: const TextStyle(
color: Colors.white,
fontSize: 12,
fontWeight: FontWeight.bold,
),
textAlign: TextAlign.center,
),
),
),
],
// Tanggal
Expanded(
child: Center(
child: Text(
jadwal.tanggalPenyaluran != null
? DateFormat('dd')
.format(jadwal.tanggalPenyaluran!)
: '-',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
color: statusColor,
),
),
),
),
],
),
),
const SizedBox(width: 16),
// Informasi utama
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
jadwal.nama ?? 'Penyaluran Bantuan',
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
const SizedBox(height: 6),
Row(
children: [
Icon(
Icons.calendar_today,
size: 14,
color: Colors.grey.shade600,
),
const SizedBox(width: 6),
Expanded(
child: Text(
formattedDate,
style: TextStyle(
fontSize: 13,
color: Colors.grey.shade700,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
],
),
const SizedBox(height: 4),
if (jadwal.lokasiPenyaluranId != null) ...[
Row(
children: [
Icon(
Icons.location_on_outlined,
size: 14,
color: Colors.grey.shade600,
),
const SizedBox(width: 6),
Expanded(
child: Text(
jadwal.lokasiNama ??
jadwal.lokasiPenyaluranId!,
style: TextStyle(
fontSize: 13,
color: Colors.grey.shade700,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
],
),
const SizedBox(height: 4),
],
Container(
padding: const EdgeInsets.symmetric(
horizontal: 10, vertical: 4),
decoration: BoxDecoration(
color: statusColor.withOpacity(0.15),
borderRadius: BorderRadius.circular(20),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(
_getStatusIcon(jadwal.status),
size: 14,
color: statusColor,
),
const SizedBox(width: 4),
Text(
statusText,
style: TextStyle(
fontSize: 12,
color: statusColor,
fontWeight: FontWeight.bold,
),
),
],
),
),
],
),
),
],
),
if (jadwal.deskripsi != null &&
jadwal.deskripsi!.isNotEmpty) ...[
const Divider(height: 24),
Text(
jadwal.deskripsi!,
style: TextStyle(
fontSize: 14,
color: Colors.grey.shade700,
),
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
],
),
if (jadwal.deskripsi != null && jadwal.deskripsi!.isNotEmpty) ...[
const Divider(height: 24),
Text(
jadwal.deskripsi!,
style: TextStyle(
fontSize: 14,
color: Colors.grey.shade700,
),
maxLines: 3,
overflow: TextOverflow.ellipsis,
// Footer dengan informasi bantuan dan tombol detail
const SizedBox(height: 16),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
// Informasi bantuan yang diberikan
if (jadwal.jumlahBantuan != null) ...[
Row(
children: [
Container(
padding: const EdgeInsets.all(6),
decoration: BoxDecoration(
color: Colors.blue.withOpacity(0.1),
shape: BoxShape.circle,
),
child: const Icon(
Icons.volunteer_activism,
size: 14,
color: Colors.blue,
),
),
const SizedBox(width: 8),
Text(
'${jadwal.jumlahBantuan} bantuan',
style: const TextStyle(
fontSize: 13,
fontWeight: FontWeight.w500,
),
),
],
),
],
// Tombol lihat detail
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
color: Colors.grey.shade100,
),
padding: const EdgeInsets.symmetric(
horizontal: 12, vertical: 6),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Text(
'Lihat Detail',
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,
color: Colors.grey.shade700,
),
),
const SizedBox(width: 4),
Icon(
Icons.arrow_forward_ios,
size: 12,
color: Colors.grey.shade700,
),
],
),
),
],
),
],
],
),
),
),
),
);
}
IconData _getStatusIcon(String? status) {
switch (status) {
case 'SELESAI':
return Icons.check_circle;
case 'DIBATALKAN':
return Icons.cancel;
case 'DALAM_PROSES':
return Icons.timelapse;
default:
return Icons.event_available;
}
}
void _navigateToDetail(dynamic jadwal) {
Get.toNamed('/donatur/jadwal/${jadwal.id}', arguments: jadwal);
}
}