feat(flutter): 榜单前三铺满与剧场分类吸顶下划线

This commit is contained in:
Zhou Weidong committed 2026-10-20 15:13:12 +08:00
1 parent d80fff74ba
commit 04a1a4ee82
4 files changed
+130 -52

No files matched your search

+31 -14
View File
@@ -34,7 +34,7 @@ const double _categoryTabHeight = 44;
const double _categoryTabGap = 20;
const double _categorySelectedFontSize = 16;
const double _categoryFontSize = 15;
const double _stickyHeaderHeight = 102;
const double _stickyHeaderHeight = 44;
const Duration _stickyHeaderTransition = Duration(milliseconds: 200);
/// K28-A2 剧场页:搜索、分类/语言 chips 与双列剧库。
@@ -203,10 +203,7 @@ class _DiscoverPageState extends State<DiscoverPage> {
]
: const [],
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [_categoryTabs(l10n, categories), _toolbar(l10n, categories)],
),
child: _categoryTabs(l10n, categories),
);
}
@@ -251,6 +248,7 @@ class _DiscoverPageState extends State<DiscoverPage> {
? categories.feed.dramas
: categories.dramasOf(logic.selectedCategoryId!);
return [
_toolbar(l10n, categories),
if (dramas.isEmpty)
Padding(
padding: const EdgeInsets.symmetric(vertical: 40),
@@ -279,6 +277,7 @@ class _DiscoverPageState extends State<DiscoverPage> {
if (index == 0) {
return _categoryTab(
key: const Key('theater-category-all'),
id: 'all',
label: l10n.all,
selected: logic.selectedCategoryId == null,
onTap: () => logic.selectCategory(null),
@@ -287,6 +286,7 @@ class _DiscoverPageState extends State<DiscoverPage> {
final category = categories.categories[index - 1];
return _categoryTab(
key: Key('theater-category-${category.id}'),
id: category.id,
label: category.name,
selected: logic.selectedCategoryId == category.id,
onTap: () => logic.selectCategory(category.id),
@@ -298,6 +298,7 @@ class _DiscoverPageState extends State<DiscoverPage> {
Widget _categoryTab({
required Key key,
required String id,
required String label,
required bool selected,
required VoidCallback onTap,
@@ -306,16 +307,32 @@ class _DiscoverPageState extends State<DiscoverPage> {
key: key,
behavior: HitTestBehavior.opaque,
onTap: onTap,
child: Center(
child: Text(
label,
maxLines: 1,
style: TextStyle(
color: selected ? AppColors.onSurface : AppColors.muted,
fontSize: selected ? _categorySelectedFontSize : _categoryFontSize,
fontWeight: selected ? FontWeight.w800 : FontWeight.w500,
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
label,
maxLines: 1,
style: TextStyle(
color: selected ? AppColors.onSurface : AppColors.muted,
fontSize: selected
? _categorySelectedFontSize
: _categoryFontSize,
fontWeight: selected ? FontWeight.w800 : FontWeight.w500,
),
),
),
const SizedBox(height: 4),
Container(
key: Key('theater-category-underline-$id'),
width: 18,
height: 2,
decoration: BoxDecoration(
color: selected ? AppColors.blue : Colors.transparent,
borderRadius: BorderRadius.circular(1),
),
),
],
),
);
}