EnakNews: halaman berita dan detail berita
- Filter kategori, berita utama, dan daftar artikel terbaru - Detail artikel dengan sampul, penulis, isi, dan "Baca juga" - Data contoh 8 artikel; artikel tips mengikuti aturan di docs - Jumlah pada AppFilterChip kini opsional Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
c35d0eedbe
commit
5ba60747a8
@@ -2,18 +2,19 @@ import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../common/theme/theme.dart';
|
||||
|
||||
/// Chip filter berbentuk pil dengan jumlah item di sebelah label.
|
||||
/// Chip filter berbentuk pil, dengan jumlah item di sebelah label bila
|
||||
/// [count] diisi.
|
||||
class AppFilterChip extends StatelessWidget {
|
||||
const AppFilterChip({
|
||||
super.key,
|
||||
required this.label,
|
||||
required this.count,
|
||||
this.count,
|
||||
required this.isSelected,
|
||||
required this.onTap,
|
||||
});
|
||||
|
||||
final String label;
|
||||
final int count;
|
||||
final int? count;
|
||||
final bool isSelected;
|
||||
final VoidCallback onTap;
|
||||
|
||||
@@ -43,23 +44,28 @@ class AppFilterChip extends StatelessWidget {
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 1),
|
||||
decoration: BoxDecoration(
|
||||
color: isSelected
|
||||
? AppColor.white.withOpacity(0.2)
|
||||
: AppColor.primary.withOpacity(0.08),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: Text(
|
||||
'$count',
|
||||
style: AppStyle.xs.copyWith(
|
||||
color: isSelected ? AppColor.textWhite : AppColor.primary,
|
||||
fontWeight: FontWeight.w700,
|
||||
if (count != null) ...[
|
||||
const SizedBox(width: 6),
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 6,
|
||||
vertical: 1,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: isSelected
|
||||
? AppColor.white.withOpacity(0.2)
|
||||
: AppColor.primary.withOpacity(0.08),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: Text(
|
||||
'$count',
|
||||
style: AppStyle.xs.copyWith(
|
||||
color: isSelected ? AppColor.textWhite : AppColor.primary,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user