import 'package:flutter/material.dart'; import '../../core/theme.dart'; import '../../models/announcement_model.dart'; import '../../screens/home/pengumuman_detail_screen.dart'; class PengumumanCard extends StatelessWidget { final AnnouncementModel pengumuman; final VoidCallback? onTap; const PengumumanCard({ Key? key, required this.pengumuman, this.onTap, }) : super(key: key); @override Widget build(BuildContext context) { return Container( width: 300, margin: const EdgeInsets.only(right: AppTheme.spacingMd), decoration: BoxDecoration( gradient: const LinearGradient( begin: Alignment.topLeft, end: Alignment.bottomRight, colors: [ Color(0xFF1E293B), Color(0xFF334155), ], ), borderRadius: BorderRadius.circular(AppTheme.radiusXl), boxShadow: [ BoxShadow( color: const Color(0xFF1E293B).withValues(alpha: 0.3), blurRadius: 12, offset: const Offset(0, 6), ), ], ), child: Material( color: Colors.transparent, borderRadius: BorderRadius.circular(AppTheme.radiusXl), child: InkWell( onTap: onTap ?? () { Navigator.push( context, MaterialPageRoute( builder: (_) => PengumumanDetailScreen(pengumuman: pengumuman), ), ); }, borderRadius: BorderRadius.circular(AppTheme.radiusXl), child: Padding( padding: const EdgeInsets.all(16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ Container( padding: const EdgeInsets.all(8), decoration: BoxDecoration( color: AppTheme.primaryOrange.withValues(alpha: 0.2), borderRadius: BorderRadius.circular(10), ), child: const Icon( Icons.campaign_rounded, color: AppTheme.primaryOrange, size: 18, ), ), const SizedBox(width: 10), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( pengumuman.title, style: AppTheme.labelLarge.copyWith( color: Colors.white, fontSize: 14, ), maxLines: 1, overflow: TextOverflow.ellipsis, ), const SizedBox(height: 2), Text( pengumuman.namaPembuat, style: AppTheme.bodySmall.copyWith( color: Colors.white60, fontSize: 11, ), ), ], ), ), ], ), const SizedBox(height: 10), Text( pengumuman.description, style: AppTheme.bodySmall.copyWith( color: Colors.white70, height: 1.4, ), maxLines: 2, overflow: TextOverflow.ellipsis, ), const Spacer(), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( pengumuman.date, style: AppTheme.bodySmall.copyWith( color: Colors.white38, fontSize: 10, ), ), Container( padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 3), decoration: BoxDecoration( color: AppTheme.primaryOrange.withValues(alpha: 0.2), borderRadius: BorderRadius.circular(AppTheme.radiusFull), ), child: Row( mainAxisSize: MainAxisSize.min, children: [ Text( "Baca", style: AppTheme.bodySmall.copyWith( color: AppTheme.primaryOrange, fontWeight: FontWeight.w600, fontSize: 10, ), ), const SizedBox(width: 2), const Icon(Icons.arrow_forward_ios, color: AppTheme.primaryOrange, size: 9), ], ), ), ], ), ], ), ), ), ), ); } }