feat(flutter): 统一二级页头并恢复新剧暖色

This commit is contained in:
Zhou Weidong committed 2026-10-20 15:55:12 +08:00
1 parent 7b2970d5c5
commit 1c6c92170d
26 files changed
+492 -427

No files matched your search

+59 -75
View File
@@ -11,16 +11,18 @@ import '../../core/data/services/catalog_controller.dart';
import '../../core/formatting/count_format.dart';
import '../../core/theme/app_colors.dart';
import '../../core/widgets/remote_image.dart';
import '../../core/widgets/subpage_header.dart';
import '../../l10n/app_localizations.dart';
import '../player/open_player.dart';
const int _moreLimit = 12;
const int _filmHoles = 8;
const Color _premiereTop = Color(0xFF1F1B16);
const Color _premiereBottom = Color(0xFF2E2119);
const Color _filmHole = Color(0x33FFFFFF);
const double _cardPadding = 8;
const double _cardWidth = 124;
const double _rowHeight = 204;
const double _cardRadius = 12;
/// 新剧页:暗色首映厅,今日首映大卡 + 横向更多新剧。
/// 新剧页:暖色首映厅,今日首映大卡 + 横向更多新剧。
class NewReleasesPage extends StatelessWidget {
const NewReleasesPage({super.key});
@@ -32,29 +34,35 @@ class NewReleasesPage extends StatelessWidget {
final hero = dramas.isEmpty ? null : dramas.first;
final more = dramas.skip(1).take(_moreLimit).toList();
return AnnotatedRegion<SystemUiOverlayStyle>(
value: SystemUiOverlayStyle.light,
value: SystemUiOverlayStyle.dark,
child: Scaffold(
key: const Key('new-releases-page'),
backgroundColor: AppColors.ink,
body: DecoratedBox(
decoration: const BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [_premiereTop, _premiereBottom],
colors: [AppColors.surfaceTop, AppColors.ink],
),
),
child: SafeArea(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_header(context, l10n, dramas.length),
AppSubpageHeader(
title: l10n.newReleasesTitle,
subtitle: l10n.newReleasesSubtitle,
backKey: const Key('new-releases-back'),
actions: _countChip(l10n, dramas.length),
),
Expanded(
child: hero == null
? Center(
child: Text(
l10n.noStories,
key: const Key('new-releases-empty'),
style: const TextStyle(color: Colors.white70),
style: const TextStyle(color: AppColors.muted),
),
)
: ListView(
@@ -73,7 +81,7 @@ class NewReleasesPage extends StatelessWidget {
_moreHeader(l10n),
const SizedBox(height: 10),
SizedBox(
height: 196,
height: _rowHeight,
child: ListView.separated(
key: const Key('new-releases-row'),
scrollDirection: Axis.horizontal,
@@ -103,63 +111,21 @@ class NewReleasesPage extends StatelessWidget {
);
}
Widget _header(BuildContext context, AppLocalizations l10n, int count) {
return Padding(
padding: const EdgeInsets.fromLTRB(6, 4, 16, 8),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
IconButton(
key: const Key('new-releases-back'),
tooltip: MaterialLocalizations.of(context).backButtonTooltip,
onPressed: () => Navigator.of(context).maybePop(),
icon: const Icon(
Icons.chevron_left_rounded,
color: Colors.white,
size: 26,
),
),
Expanded(
child: Text(
l10n.newReleasesTitle,
style: const TextStyle(
color: Colors.white,
fontSize: 26,
fontWeight: FontWeight.w900,
),
),
),
Container(
key: const Key('new-releases-count'),
padding: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration(
color: AppColors.blue,
borderRadius: BorderRadius.circular(999),
),
child: Text(
l10n.newReleasesCount(count),
style: const TextStyle(
color: Colors.white,
fontSize: 11,
fontWeight: FontWeight.w700,
),
),
),
],
),
Padding(
padding: const EdgeInsets.only(left: 8),
child: Text(
l10n.newReleasesSubtitle,
style: const TextStyle(color: Colors.white70, fontSize: 12),
),
),
],
Widget _countChip(AppLocalizations l10n, int count) {
return Container(
key: const Key('new-releases-count'),
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 5),
decoration: BoxDecoration(
color: AppColors.badgeBeige,
borderRadius: BorderRadius.circular(999),
),
child: Text(
l10n.newReleasesCount(count),
style: const TextStyle(
color: AppColors.blue,
fontSize: 11,
fontWeight: FontWeight.w700,
),
),
);
}
@@ -286,7 +252,7 @@ class NewReleasesPage extends StatelessWidget {
child: Text(
l10n.rankingNew,
style: const TextStyle(
color: Colors.white,
color: AppColors.onSurface,
fontSize: 16,
fontWeight: FontWeight.w800,
),
@@ -294,7 +260,7 @@ class NewReleasesPage extends StatelessWidget {
),
Text(
l10n.seeAll,
style: const TextStyle(color: Colors.white54, fontSize: 12),
style: const TextStyle(color: AppColors.subtle, fontSize: 12),
),
],
),
@@ -310,13 +276,25 @@ class NewReleasesPage extends StatelessWidget {
return GestureDetector(
key: Key('new-release-card-${drama.id}'),
onTap: () => unawaited(playDramaFromCatalog(context, drama)),
child: SizedBox(
width: 108,
child: Container(
width: _cardWidth,
padding: const EdgeInsets.all(_cardPadding),
decoration: BoxDecoration(
color: AppColors.card,
borderRadius: BorderRadius.circular(_cardRadius),
boxShadow: const [
BoxShadow(
color: AppColors.cardShadow,
blurRadius: 12,
offset: Offset(0, 4),
),
],
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ClipRRect(
borderRadius: BorderRadius.circular(12),
borderRadius: BorderRadius.circular(8),
child: SizedBox(
width: 108,
height: 144,
@@ -348,7 +326,7 @@ class NewReleasesPage extends StatelessWidget {
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: const TextStyle(
color: Colors.white,
color: AppColors.onSurface,
fontSize: 13,
fontWeight: FontWeight.w700,
),
@@ -356,7 +334,7 @@ class NewReleasesPage extends StatelessWidget {
const SizedBox(height: 2),
Text(
_releaseDate(index),
style: const TextStyle(color: Colors.white54, fontSize: 12),
style: const TextStyle(color: AppColors.subtle, fontSize: 12),
),
],
),
@@ -407,7 +385,13 @@ class _FilmStrip extends StatelessWidget {
return Container(
key: const Key('new-releases-film'),
height: 22,
color: const Color(0x1A000000),
decoration: const BoxDecoration(
color: AppColors.raised,
border: Border(
top: BorderSide(color: AppColors.border),
bottom: BorderSide(color: AppColors.border),
),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [_holes(), _holes()],
@@ -424,7 +408,7 @@ class _FilmStrip extends StatelessWidget {
width: 6,
height: 8,
decoration: BoxDecoration(
color: _filmHole,
color: AppColors.border,
borderRadius: BorderRadius.circular(2),
),
),