import 'package:flutter/material.dart'; import '../../../../common/theme/theme.dart'; import '../../../../sample/news_sample_data.dart'; import '../news_ui.dart'; /// Berita utama: sampul lebar di atas, judul dan ringkasan di bawahnya. /// /// Teks tidak ditumpuk di atas foto karena sampul outlet sering berupa /// banner bertulisan. class NewsHeadlineCard extends StatelessWidget { const NewsHeadlineCard({ super.key, required this.article, required this.onTap, }); final NewsArticle article; final VoidCallback onTap; @override Widget build(BuildContext context) { return Material( color: AppColor.white, borderRadius: BorderRadius.circular(20), clipBehavior: Clip.antiAlias, child: InkWell( onTap: onTap, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ AspectRatio( aspectRatio: 16 / 9, child: NewsCover(article: article, iconSize: 64), ), Padding( padding: const EdgeInsets.fromLTRB(16, 14, 16, 16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ NewsCategoryPill(category: article.category), const SizedBox(height: 8), Text( article.title, maxLines: 3, overflow: TextOverflow.ellipsis, style: AppStyle.xl.copyWith( fontWeight: FontWeight.w800, height: 1.25, ), ), const SizedBox(height: 6), Text( article.summary, maxLines: 2, overflow: TextOverflow.ellipsis, style: AppStyle.sm.copyWith( color: AppColor.textSecondary, height: 1.4, ), ), const SizedBox(height: 10), Text( newsMetaLabel(article), style: AppStyle.xs.copyWith( color: AppColor.textSecondary, fontWeight: FontWeight.w600, ), ), ], ), ), ], ), ), ); } }